[Cryptography-dev] Cipher/tls cipher negotiated

Karan karan karan7868 at gmail.com
Thu Jul 13 20:49:46 EDT 2017


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cryptography-dev/attachments/20170713/b8a9bae7/attachment.html>


More information about the Cryptography-dev mailing list