This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients kiilerix, pitrou
Date 2012-01-08.17:50:59
SpamBayes Score 4.164053e-07
Marked as misclassified No
Message-id <1326044979.3374.27.camel@localhost.localdomain>
In-reply-to <1326043314.86.0.512929381574.issue13721@psf.upfronthosting.co.za>
Content
> The only way to reliably implement the documented wrap_socket API
> might thus be to maintain a flag in PySocketSockObject.

Agreed. With the annoyance that the flag must be exposed to Python code,
since ssl's wrap_socket is written in Python. It may be private, though.

> Introducing a new and more explicit way of wrapping connected sockets
> might be a simpler and more stable solution.

I'm a bit wary of API bloat here.

> From another perspective: Any user of sockets must be aware that
> socket operations can fail at any time. It might thus not be a problem
> that wrap_socket fails to fail, as long as the programmer knows how to
> catch the failure in the next operation. From that point of view the
> problem is that it is surprising and undocumented how getpeercert can
> fail.

Thanks. So fixing how getpeercert behaves and either raise a dedicated
error or return None would improve things here, right?
History
Date User Action Args
2012-01-08 17:51:00pitrousetrecipients: + pitrou, kiilerix
2012-01-08 17:50:59pitroulinkissue13721 messages
2012-01-08 17:50:59pitroucreate