New submission from Dariusz Suchojad:

Hello,

I'd like to suggest adding a simple note to SSLSocket.getpeercert stating that 
it will always return None if do_handshake has never been called.

This is not the default behaviour, by default SSLSocket.__init__'s 
do_handshake_on_connect is True so .getpeercert nicely returns a cert (assuming 
the usual caveats - the other side offers a certificate and cert_reqs is not 
CERT_NONE).

However, I've just been debugging a someone else's server and I spent some time 
figuring out why client certificates weren't available - turned out this was 
because do_handshake was never called (PySSL_SSLdo_handshake in _ssl.c).

Adding a single-sentence line will certainly be very helpful.

Many thanks!

----------
assignee: docs@python
components: Documentation
messages: 198425
nosy: docs@python, dsuch
priority: normal
severity: normal
status: open
title: Document SSLSocket.getpeercert always returns None without do_handshake
type: enhancement

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19095>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to