File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 4949except ImportError :
5050 pyopenssl_override = False
5151
52+ try : # pragma: no cover
53+ from aiohttp import TCPConnector
54+
55+ aiohttp_make_ssl_context_cache_clear = TCPConnector ._make_ssl_context .cache_clear
56+ except (ImportError , AttributeError ):
57+ aiohttp_make_ssl_context_cache_clear = None
58+
5259
5360true_socket = socket .socket
5461true_create_connection = socket .create_connection
@@ -548,6 +555,8 @@ def enable(namespace=None, truesocket_recording_dir=None):
548555 if pyopenssl_override : # pragma: no cover
549556 # Take out the pyopenssl version - use the default implementation
550557 extract_from_urllib3 ()
558+ if aiohttp_make_ssl_context_cache_clear : # pragma: no cover
559+ aiohttp_make_ssl_context_cache_clear ()
551560
552561 @staticmethod
553562 def disable ():
@@ -584,6 +593,8 @@ def disable():
584593 if pyopenssl_override : # pragma: no cover
585594 # Put the pyopenssl version back in place
586595 inject_into_urllib3 ()
596+ if aiohttp_make_ssl_context_cache_clear : # pragma: no cover
597+ aiohttp_make_ssl_context_cache_clear ()
587598
588599 @classmethod
589600 def get_namespace (cls ):
You can’t perform that action at this time.
0 commit comments