bpo-29334: Fix ssl.getpeercert for auto-handshake (#1769) · python/cpython@66dc33b · GitHub
Skip to content

Commit 66dc33b

Browse files
authored
bpo-29334: Fix ssl.getpeercert for auto-handshake (#1769)
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>
1 parent e0918ec commit 66dc33b

1 file changed

Lines changed: 11 additions & 19 deletions

File tree

Modules/_ssl.c

Lines changed: 11 additions & 19 deletions

0 commit comments

Comments
 (0)