Why TLSv1_2 connection is successful with older OpenSSL version in Python httplib
<p>I am using Windows 7 OS. OpenSSL is installed in the system.</p>

<pre><code>C:\Program Files (x86)\Git\bin&gt;openssl version
OpenSSL 0.9.8e 23 Feb 2007
</code></pre>

<p>I have a server which supports only TLSv1_2. As per documentation of OpenSSL, TLSv1_2 is supported in OpenSSL >=1.0.1. So as my installed OpenSSL is of version 0.9.8, I am expecting a failure during HTTPS connection/transaction.</p>

<p><a href="https://docs.python.org/3/library/ssl.html" rel="nofollow">https://docs.python.org/3/library/ssl.html</a></p>

<p>But still, I am able to communicate with the server using HTTPS rest APIs using TLSv1_2. Why?
My implementation is,</p>

<pre><code>httpObj = httplib.HTTPSConnection('server_name')
httpObj.sock = socket.create_connection(('server_name', '10443'))

httpObj.sock = ssl.wrap_socket(httpObj.sock, keyfile='.\\key.pem', certfile='.\\client_cert.pem', ca_certs='.\\ca_cert.pem', ciphers='ECDHE-RSA-AES256-GCM-SHA384', cert_reqs=ssl.CERT_REQUIRED, ssl_version=ssl.PROTOCOL_TLSv1_2)

headers = {'Accept': 'application/json', 'Accept-Language': 'en-us, en', 'Accept-Charset': 'ISO-8859-1, utf-8'}

httpObj.request('GET', URI, '', headers)
print httpObj.getresponse()
</code></pre>

<p>(There is no implementation issue in server, because I tried to connect from my linux machine with TLSv1_1 protocol and it did not work. With TLSv1_2, it worked which is expected behavior for OpenSSL version 1.0.1. In linux machine I have openssl version 1.0.1e)</p>