Skip to content

[3.6] bpo-29334: Fix ssl.getpeercert for auto-handshake (GH-1769) #1778

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2017

Conversation

tiran
Copy link
Member

@tiran tiran commented May 23, 2017

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 [email protected].
(cherry picked from commit 66dc33b)

https://bugs.python.org/issue29334

@Mariatta
Copy link
Member

Is this ready for merging?

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 <[email protected]>.
(cherry picked from commit 66dc33b)
@tiran tiran force-pushed the backport-66dc33b-3.6 branch from 91f413f to ed00fc4 Compare September 5, 2017 17:18
@tiran tiran added the skip news label Sep 5, 2017
@tiran tiran merged commit 63b3f2b into python:3.6 Sep 5, 2017
@tiran tiran deleted the backport-66dc33b-3.6 branch September 5, 2017 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants