bpo-34975: Add start_tls() method to streams API#13143
bpo-34975: Add start_tls() method to streams API#13143icgood wants to merge 1 commit intopython:masterfrom icgood:fix-issue-34975
Conversation
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.
|
Fixed by #13251 |
|
@asvetlov Can this PR be reopened? #13251 got refused and was reverted by #16482 with the following explainer in bpo-38242:
I'm bringing this PR up because I need to port @icgood Could you also add |
I'd be happy to, if we get the go-ahead to reopen and proceed. I've been using undocumented API in my library for years now, in lieu of a fix in CPython: https://github.com/icgood/pymap/blob/73c52f805d5fabf91a28f89ff81dd34efcb36486/pymap/imap/__init__.py#L275 |
The existing event loop
start_tls()method is not sufficient forconnections 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 readerprotocol to the new SSL transport.
https://bugs.python.org/issue34975