Set SSLContext.minimum_version to TLSv1.2

`ssl.OP_NO_TLSv1` and `ssl.OP_NO_TLSv1_1` deprecated since Python 3.7 and OpenSSL 1.1.0.

Ref: #1870
This commit is contained in:
JonnyWong16 2022-11-13 01:03:07 -08:00
parent 977eec8a66
commit 1cdb55a6a9
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -106,10 +106,7 @@ def initialize(options):
purpose=ssl.Purpose.CLIENT_AUTH, purpose=ssl.Purpose.CLIENT_AUTH,
cafile=https_cert_chain cafile=https_cert_chain
) )
# Context options: context.minimum_version = ssl.TLSVersion.TLSv1_2
# PROTOCOL_TLS_SERVER | OP_NO_SSLv2 | OP_NO_SSLv3 | OP_NO_TLSv1 | OP_NO_TLSv1_1
context.options |= ssl.OP_NO_TLSv1
context.options |= ssl.OP_NO_TLSv1_1
context.load_cert_chain(https_cert, https_key) context.load_cert_chain(https_cert, https_key)
options_dict['server.ssl_context'] = context options_dict['server.ssl_context'] = context