Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 14, 2023
1 parent 0b80b31 commit d9172ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion aiohttp/client_reqrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,9 @@ async def start(self, connection: "Connection") -> "ClientResponse":
self._continue = None

# certificate
is_tls_transport = self._connection is not None and self._connection.transport is not None
is_tls_transport = (
self._connection is not None and self._connection.transport is not None
)
if is_tls_transport:
self.certificate = self._connection.transport.get_extra_info("peercert")

Expand Down
10 changes: 9 additions & 1 deletion tests/test_client_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,15 @@ async def handler(request):
async with aiohttp.ClientSession() as session:
resp = await session.get("https://127.0.0.1:8443", ssl=client_ssl_ctx)
assert frozenset(resp.certificate) >= frozenset(
("subject", "issuer", "version", "serialNumber", "notBefore", "notAfter", "subjectAltName")
(
"subject",
"issuer",
"version",
"serialNumber",
"notBefore",
"notAfter",
"subjectAltName",
)
)
resp.close()
await site.stop()
Expand Down

0 comments on commit d9172ae

Please sign in to comment.