]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.6] bpo-29334: Fix ssl.getpeercert for auto-handshake (GH-1769) (#1778)
authorChristian Heimes <christian@python.org>
Tue, 5 Sep 2017 20:43:05 +0000 (13:43 -0700)
committerGitHub <noreply@github.com>
Tue, 5 Sep 2017 20:43:05 +0000 (13:43 -0700)
commit63b3f2b19cc96801c3b8619e4cf8aa9028e7a33c
tree2e27789a66a12671ebdbf2b3c0cd99909ca67a33
parentf201e886fc7aaeb50f5e945578c6aec2a59a5323
[3.6] bpo-29334: Fix ssl.getpeercert for auto-handshake (GH-1769) (#1778)

Drop handshake_done and peer_cert members from PySSLSocket struct. The
peer certificate can be acquired from *SSL directly.
SSL_get_peer_certificate() does not trigger any network activity.
Instead of manually tracking the handshake state, simply use
SSL_is_init_finished().

In combination these changes fix auto-handshake for non-blocking
MemoryBIO connections.

Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 66dc33b6822be93f85d84d24d3f9159ff568fbbb)
Modules/_ssl.c