diff --git a/aiohttp/client_reqrep.py b/aiohttp/client_reqrep.py index 9478e8d36c5..0621c971340 100644 --- a/aiohttp/client_reqrep.py +++ b/aiohttp/client_reqrep.py @@ -698,6 +698,7 @@ def __init__( self.method = method self.cookies: SimpleCookie[str] = SimpleCookie() + self.certficate: Optional[Dict[str, Union[tuple, int, str]]] = None self._real_url = url self._url = url.with_fragment(None) @@ -887,6 +888,7 @@ def _response_eof(self) -> None: return if self._connection is not None: + self.certificate = self._connection.transport.get_extra_info("peercert") # websocket, protocol could be None because # connection could be detached if (