kn1g78 · GitHub

Bug report

Bug description:

After StreamWriter.start_tls() upgrades a stream to TLS, the StreamWriter
and StreamReaderProtocol are updated to use the new transport, but the linked
StreamReader still keeps the old transport.

The relevant code path is in StreamReaderProtocol._replace_transport()
(Lib/asyncio/streams.py:216). The linked StreamReader transport can be
updated in the same path (Lib/asyncio/streams.py:481).

StreamWriter, StreamReaderProtocol, and StreamReader should all refer to
the upgraded transport after start_tls().

CPython versions tested on:

3.16

Operating systems tested on:

Windows

Linked PRs

Read the original on github.com ↗