[issue31453] ssl.PROTOCOL_TLS only select TLSv1.2

Christian Heimes report at bugs.python.org
Wed Sep 13 12:16:33 EDT 2017


Christian Heimes added the comment:

You have to enable the protocols by applying a reverse bitmask to SSLContext.options:

ctx = ssl.SSLContext(ssl.PROTOCOL_TLS)
ctx.load_cert_chain('server.pem')
ctx.options &= ~(ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1)

sslsock = ctx.wrap_socket(s, server_side=True)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31453>
_______________________________________


More information about the Python-bugs-list mailing list