[issue13721] ssl.wrap_socket on a connected but failed connection succeeds and .peer_certificate gives AttributeError

Antoine Pitrou report at bugs.python.org
Sat Jan 7 01:26:53 CET 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

> I hope the proper fix will ensure that an exception always is raised
> if the ssl handshake fails - and that a successful wrap_socket means
> that the ssl negotiation did succeed with the given constraints. It
> might however only be feasible to fix that for 3.x.

Actually, the handshake is not even attempted because getpeername()
returns ENOTCONN, which is interpreted as meaning "the socket hasn't
been connected yet". Any idea how to improve that?

(I find it strange that ENOTCONN is returned rather than say ECONNRESET)

----------

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


More information about the Python-bugs-list mailing list