Force TLS 1.2
in Python 2.7.14
Hi I need to update my python code (version 2.7.14) which uses urllib2.open
to force it to use TLS1.2
So far I have tried
Sending TLS 1.2 request in Python 2.6
But I get AttributeError("'module' object has no attribute 'SSLContext'",)
ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
response = urllib2.urlopen(url, context=ctx).read()
The options I have SSLContext are
PROTOCOL_TLSv1
PROTOCOL_SSLv23
PROTOCOL_SSLv2
PROTOCOL_SSLv3
PROTOCOL_TLSv2
is not available