[issue21965] Add support for Memory BIO to _ssl

Antoine Pitrou report at bugs.python.org
Mon Oct 6 00:19:08 CEST 2014


Antoine Pitrou added the comment:

Le 05/10/2014 23:24, Geert Jansen a écrit :
> 
> Yes, it could be done quite easily. SslPipe has no dependency on
> other
parts of Gruvi and if this is for Python 3.5 only then you don't need
sslcompat either.

Yes, it works. Note that I had to modify SSLPipe to also notify of
handshake failures (by passing an argument to the handshake callback).

Here is draft diff against asyncio:
https://gist.github.com/pitrou/f04fa9cbfec88cc37050

However, I don't think this the right approach actually. Rather, the SSL
layer should be implemented as a Protocol object that's also able to act
as a transport for the actual application-level Protocol. It would
completely decouple it from the transport and event loop implementation
details.

(I think that's how Twisted does it, btw)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21965>
_______________________________________


More information about the Python-bugs-list mailing list