From 5620925f83ff30d5cc173863263d1181812679af Mon Sep 17 00:00:00 2001 From: Chris Kelley Date: Wed, 26 Jul 2023 13:46:10 +0100 Subject: [PATCH] Replace deprecated ssl.PROTOCOL_TLS in pki/client.py Resolves #4512 --- base/common/python/pki/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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: