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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -4,7 +4,7 @@ from __future__ import annotations
from collections import OrderedDict
from collections.abc import Callable
import queue
from ssl import PROTOCOL_TLS, SSLContext, SSLError
from ssl import PROTOCOL_TLS_CLIENT, SSLContext, SSLError
from types import MappingProxyType
from typing import Any
@ -789,7 +789,7 @@ def check_certicate_chain() -> str | None:
except (TypeError, ValueError):
return "bad_client_key"
# Check the certificate chain
context = SSLContext(PROTOCOL_TLS)
context = SSLContext(PROTOCOL_TLS_CLIENT)
if client_certificate and private_key:
try:
context.load_cert_chain(client_certificate, private_key)