[issue22564] ssl: post-commit review of the new memory BIO API

Geert Jansen report at bugs.python.org
Tue Oct 7 04:10:33 CEST 2014


Geert Jansen added the comment:

> newPySSLSocket() expects a char* string and use PyUnicode_Decode() to decode bytes.

Yup, and this value is available as SSLSocket._sslobj.server_hostname. But SSLSocket.server_hostname is not this, it is what was passed to the constructor which can be a bytes instance.

For total cleanness maybe the constructor should raise a TypeError if server_hostname is passes as a bytes.

----------

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


More information about the Python-bugs-list mailing list