Skip to content

Commit cf45ea7

Browse files
Fix asyncio SSL warning when using proxy tunneling (#249)
* Fix asyncio SSL warning when using proxy tunneling * Update httpcore/_backends/asyncio.py
1 parent 8dbd5cc commit cf45ea7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

httpcore/_backends/asyncio.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ async def start_tls(
120120
timeout=timeout.get("connect"),
121121
)
122122

123-
stream_reader.set_transport(transport)
123+
# Initialize the protocol, so it is made aware of being tied to
124+
# a TLS connection.
125+
# See: https://github.com/encode/httpx/issues/859
126+
protocol.connection_made(transport)
127+
124128
stream_writer = asyncio.StreamWriter(
125129
transport=transport, protocol=protocol, reader=stream_reader, loop=loop
126130
)

0 commit comments

Comments
 (0)