[issue21965] Add support for Memory BIO to _ssl

Geert Jansen report at bugs.python.org
Fri Oct 3 12:52:58 CEST 2014


Geert Jansen added the comment:

New patch attached. This patch makes SSLSocket use SSLObject. The big benefit here is obviously test coverage.

I decided against using SSLObject as a mixin, because all methods need to be reimplemented anyway because for SSLSocket they need to handle the non-SSL case. Instead, I made SSLSocket._sslobj an SSLObject rather than a _ssl._SSLSocket. The patch is rather small, so I kept it incremental to patch4.

Test suite runs fine. I had to update one SSL test (test_unknown_channel_binding). Because the test for the binding type is now in SSLObject, a non-connected SSLSocket will return None even for an unknown binding. Arguably this is even more correct because the binding type can depend on the cryptographic protocol used, e.g. tls-unique doesn't work for SSLv2 (it's currently not checked and nobody cares about SSLv2, I'm just arguing from theory here).

A second change is that the private _sslobj is now a different type. However since this is clearly an internal attribute, I think people that are using this should expect breakage.

Antoine, please let me know if this is now ready for merging in your view or if not what you'd like me to do still. Thanks.

----------
Added file: http://bugs.python.org/file36791/ssl-memory-bio-4-incr2.patch

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


More information about the Python-bugs-list mailing list