Skip to content

Commit

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

Co-authored-by: Sam Bull <git@sambull.org>
Fixes #3355
  • Loading branch information
patchback[bot] committed Jul 9, 2023
1 parent a652ca9 commit 13047ee
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 @@ -1130,6 +1130,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 13047ee

Please sign in to comment.