Elizabeth Myers added the comment:

It seems pretty simple to just make a function that returns a new transport, 
something like "transport = yield from loop.ssl_wrap_transport(transport)". I'm 
not sure how to handle plaintext data left on the wire, though, unless that's 
not really a consideration (given most (all?) real-world protocols can (and 
usually do) wait for the SSL handshake before sending more data when STARTTLS 
has been requested).

For the higher-level API, I'm thinking "reader, writer = 
asyncio.ssl_wrap(reader, writer)" maybe? You can't have half-closed SSL 
connections, so you would have to pass them both in. 

As for replacing the protocol but keeping the transport, what would be the 
semantics of that? I can't really think of how to do that one. I do know SMTP 
clears all state, but some protocols might not (IRC is a key example - this 
isn't usually a problem since you are supposed to negotiate it early on before 
you log onto the server), so this shouldn't be mandatory.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23749>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to