workaround for requests 2.32.3 (#5665)
manually call 'load_default_certs()' for SSLContexts in custom HTTPAdapter instances
This commit is contained in:
@@ -837,6 +837,9 @@ def _build_requests_adapter(ssl_options, ssl_ciphers, source_address):
|
|||||||
if ssl_options or ssl_ciphers:
|
if ssl_options or ssl_ciphers:
|
||||||
ssl_context = urllib3.connection.create_urllib3_context(
|
ssl_context = urllib3.connection.create_urllib3_context(
|
||||||
options=ssl_options or None, ciphers=ssl_ciphers)
|
options=ssl_options or None, ciphers=ssl_ciphers)
|
||||||
|
if requests.__version__ > "2.31":
|
||||||
|
# https://github.com/psf/requests/pull/6731
|
||||||
|
ssl_context.load_default_certs()
|
||||||
ssl_context.check_hostname = False
|
ssl_context.check_hostname = False
|
||||||
else:
|
else:
|
||||||
ssl_context = None
|
ssl_context = None
|
||||||
|
|||||||
Reference in New Issue
Block a user