diff --git a/lbrynet/utils.py b/lbrynet/utils.py index 82c1ac738..f48751c48 100644 --- a/lbrynet/utils.py +++ b/lbrynet/utils.py @@ -163,14 +163,14 @@ async def resolve_host(url: str, port: int, proto: str) -> str: ))[0][4][0] -def get_ssl_context(): +def get_ssl_context() -> ssl.SSLContext: return ssl.create_default_context( purpose=ssl.Purpose.CLIENT_AUTH, capath=None if 'darwin' not in sys.platform else certifi.where() ) @contextlib.asynccontextmanager -async def aiohttp_request(method, url, **kwargs): +async def aiohttp_request(method, url, **kwargs) -> typing.AsyncContextManager[aiohttp.ClientResponse]: async with aiohttp.ClientSession() as session: async with session.request(method, url, ssl=get_ssl_context(), **kwargs) as response: yield response