Replace deprecated SSLContext constant PROTOCOL_TLS in mqtt (#88214)
Replace deprecated SSLContext constants
This commit is contained in:
parent
c79157208b
commit
57738fbb8c
4 changed files with 6 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue