diff --git a/src/compat.py b/src/compat.py index 9f60a25755..025f5d4d8d 100644 --- a/src/compat.py +++ b/src/compat.py @@ -94,6 +94,9 @@ async def __aexit__(self, exc_type, exc_value, traceback): ) +# Reuse SSLContext as aiohttp does: +# https://github.com/aio-libs/aiohttp/blob/b51610b93b2ae15c4062e3a1680a536ba5f4c5c4/aiohttp/connector.py#L906 +@functools.lru_cache(None) def ssl_create_default_context(): """`ssl.create_default_context`""" context = ssl.create_default_context()