Thanks for the prompt reply *Alex !*

I have sent my question to the requests mailing list. I'm using the pythons
native ssl library not the pyOpenSSL libary as i can use the ssl's library
context in the Adapter. I looked into the requests response object but
could'nt find a way to the ciphers from it.

I wanted to use the requests package as it provides a higher level library
to call into the get,post calls. But i'm not sure how i can interface the
OpenSSL Context with the requests, do you know if there is any way i could
do that.

Thanks,
Konteya.

On Thu, Jul 13, 2017 at 5:49 PM, Karan karan <karan7...@gmail.com> wrote:

> Hi,
>
> I'm trying to test different cipher and protocols using the request
> packages, for which i extend the HTTPAdapter. Here are some of the code
> snippet i have :
> https://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/
>
> and then wrap it in Session object as follows:
>
> from ssl import SSLContext
> ...
> def create_connection(self, sessionreuse=None):
> """
> Create a http connection over ssl
>     Arguments:
>     Returns:   returns the Session object, which can use to be make HTTP
> call
>
> """
> if self._ssl_version and self._cipher:
> self._context = SSLContext(self._ssl_version)
> self._context.set_ciphers(self._ciphers)
> cipher_adapter = SSLAdapter({'ssl_context': self._context})
> if self._proxy:
> self._session.update(proxies)
> self._session.mount('https://', cipher_adapter)
> return self._session
>
> Then i use self._session to make get call.
>
> What i need to find is the :
> - SSL version negotatiated finally
> - Cipher used by the server.
>
> I would appreciate if some one could help out on it.
>
> Thanks,
> Karan.
>
_______________________________________________
Cryptography-dev mailing list
Cryptography-dev@python.org
https://mail.python.org/mailman/listinfo/cryptography-dev

Reply via email to