Skip to content

Commit

Permalink
[PR #7333/3a54d378 backport][3.8] Fix TLS transport is None error (#…
Browse files Browse the repository at this point in the history
…7357)

Co-authored-by: Sam Bull <git@sambull.org>
Fixes #3355
  • Loading branch information
patchback[bot] authored Jul 9, 2023
1 parent dd8e24e commit 8d45f9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES/3355.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a transport is :data:`None` error -- by :user:`Dreamsorcerer`.
3 changes: 3 additions & 0 deletions aiohttp/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,9 @@ async def _start_tls_connection(
f"[{type_err!s}]"
) from type_err
else:
if tls_transport is None:
msg = "Failed to start TLS (possibly caused by closing transport)"
raise client_error(req.connection_key, OSError(msg))
tls_proto.connection_made(
tls_transport
) # Kick the state machine of the new TLS protocol
Expand Down

0 comments on commit 8d45f9c

Please sign in to comment.