]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-79156: Add start_tls() method to streams API (#91453)
authorOleg Iarygin <oleg@arhadthedev.net>
Fri, 15 Apr 2022 12:23:14 +0000 (15:23 +0300)
committerGitHub <noreply@github.com>
Fri, 15 Apr 2022 12:23:14 +0000 (14:23 +0200)
commit6217864fe5f6855f59d608733ce83fd4466e1b8c
tree3d852fadd0e29891d382ed9f41f161b237b3e703
parentbd26ef5e9e701d2ab3509a49d9351259a3670772
gh-79156: Add start_tls() method to streams API (#91453)

The existing event loop `start_tls()` method is not sufficient for
connections using the streams API. The existing StreamReader works
because the new transport passes received data to the original protocol.
The StreamWriter must then write data to the new transport, and the
StreamReaderProtocol must be updated to close the new transport
correctly.

The new StreamWriter `start_tls()` updates itself and the reader
protocol to the new SSL transport.

Co-authored-by: Ian Good <icgood@gmail.com>
Doc/library/asyncio-stream.rst
Doc/whatsnew/3.11.rst
Lib/asyncio/streams.py
Lib/test/test_asyncio/test_streams.py
Misc/NEWS.d/next/Library/2019-05-06-23-36-34.bpo-34975.eb49jr.rst [new file with mode: 0644]