Replace deprecated SSLContext constant PROTOCOL_TLS in mqtt (#88214)

Replace deprecated SSLContext constants
This commit is contained in:
Jan Bouwhuis
2023-02-16 19:01:28 +01:00
committed by GitHub
parent c79157208b
commit 57738fbb8c
4 changed files with 6 additions and 6 deletions

View File

@@ -23,7 +23,7 @@ def server_context_modern() -> ssl.SSLContext:
https://wiki.mozilla.org/Security/Server_Side_TLS
Modern guidelines are followed.
"""
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
context.options |= (
ssl.OP_NO_SSLv2
@@ -53,7 +53,7 @@ def server_context_intermediate() -> ssl.SSLContext:
https://wiki.mozilla.org/Security/Server_Side_TLS
Intermediate guidelines are followed.
"""
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
context.options |= (
ssl.OP_NO_SSLv2 | ssl.OP_NO_SSLv3 | ssl.OP_CIPHER_SERVER_PREFERENCE