New submission from Peter Saveliev:
Important: only Python2 versions are affected. Python3 works OK.
Possibly related issue: http://bugs.python.org/issue12378 (differs: see the
line above)
Having a server with SSLSocket waiting for connections, the incoming
connection, failed on automatic
Peter Saveliev added the comment:
Possible solution would be something like that in SSLSocket.do_handshake():
try:
self._sslobj.do_handshake()
except SSLError as e: # or even any Exception?
self._sock.close()
raise e
--
Antoine Pitrou added the comment:
Thanks for reporting. For maximum backwards compatibility, the safer fix is to
close the socket only in SSLSocket.accept().
Unfortunately I can't think of a way to write a unittest for it, so I'll just
commit the fix.
--
nosy: +pitrou
Changes by Antoine Pitrou pit...@free.fr:
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17918
___
Roundup Robot added the comment:
New changeset 85e5a93e534e by Antoine Pitrou in branch '2.7':
Issue #17918: When using SSLSocket.accept(), if the SSL handshake failed on the
new socket, the socket would linger indefinitely.
http://hg.python.org/cpython/rev/85e5a93e534e
--
nosy: