Skip to content

Commit 8d45f9c

Browse files
[PR #7333/3a54d378 backport][3.8] Fix TLS transport is None error (#7357)
Co-authored-by: Sam Bull <git@sambull.org> Fixes #3355
1 parent dd8e24e commit 8d45f9c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGES/3355.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed a transport is :data:`None` error -- by :user:`Dreamsorcerer`.

aiohttp/connector.py

+3
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,9 @@ async def _start_tls_connection(
11211121
f"[{type_err!s}]"
11221122
) from type_err
11231123
else:
1124+
if tls_transport is None:
1125+
msg = "Failed to start TLS (possibly caused by closing transport)"
1126+
raise client_error(req.connection_key, OSError(msg))
11241127
tls_proto.connection_made(
11251128
tls_transport
11261129
) # Kick the state machine of the new TLS protocol

0 commit comments

Comments
 (0)