[issue16357] SSLSocket created from SSLContext.wrap_socket doesn't include cert/keyfile

Jeff McNeil report at bugs.python.org
Mon Oct 29 22:23:47 CET 2012


Jeff McNeil added the comment:

Ak! Yes, cut and paste error.

Python 3.4.0a0 (default:57a33af85407, Oct 27 2012, 21:26:30) 
[GCC 4.4.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl          
>>> c = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
>>> c.load_cert_chain('Lib/test/keycert.pem')        
>>> import socket
>>> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
>>> s.bind(('127.0.0.1', 5050))
>>> s = c.wrap_socket(s)
>>> s.listen(5)
>>> s.accept()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jeff/cpython/Lib/ssl.py", line 557, in accept
    keyfile=self.keyfile, certfile=self.certfile,
AttributeError: 'SSLSocket' object has no attribute 'keyfile'
>>> 

I'll add a corresponding test, sure thing.

----------

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


More information about the Python-bugs-list mailing list