diff --git a/base/common/python/pki/client.py b/base/common/python/pki/client.py index 9b476a73e04..0010cfeec02 100644 --- a/base/common/python/pki/client.py +++ b/base/common/python/pki/client.py @@ -95,9 +95,9 @@ def __init__(self, pool_connections=DEFAULT_POOLSIZE, def init_poolmanager(self, connections, maxsize, block=adapters.DEFAULT_POOLBLOCK, **pool_kwargs): - context = ssl.SSLContext( - ssl.PROTOCOL_TLS # pylint: disable=no-member - ) + + tls_version = ssl.PROTOCOL_TLS_CLIENT if hasattr(ssl, "PROTOCOL_TLS_CLIENT") else ssl.PROTOCOL_TLS + context = ssl.SSLContext(tls_version) # Enable post handshake authentication for TLS 1.3 if getattr(context, "post_handshake_auth", None) is not None: