-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-37428: Don't set PHA verify flag on client side #14421
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
Conversation
7fb91b6 to
217d48b
Compare
217d48b to
06c3021
Compare
|
FWIW, I tested a manual cherrypick of this to 3.7 on macOS with OpenSSL 1.1.1c and it didn't cause any new failures in |
|
Anything we can do to expedite this? It's currently blocking 3.7.4 final and could shortly block 3.8.0 b2. @alex, would you be able to review this? Thanks! |
alex
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks right to me -- but I confess this code has changed a lot since I last looked at it, so I'd love if another person had eyes on it.
Lib/test/test_ssl.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is bpo37337 correct here? The issue addressed seems to be: https://bugs.python.org/issue37428
This might be more of a question.
I thouhght, the test should have two parts.
- Server verifying
SSL_VERIFY_POST_HANDSHAKEflag set. - Client which asserts
SSL_VERIFY_POST_HANDSHAKEnot set.
I could not figure out if the test covers both these scenarios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the BPO number in the name of the test.
The new test verifies that client_context.post_handshake_auth does not implicitly enable server cert validation on the client side. There are already several other tests that verify several combinations of PHA.
- the test case
test_pha_requiredverifies thatSSL_VERIFY_POST_HANDSHAKEon a server context works as expected. The server does request a client during handshake. SSL_VERIFY_POST_HANDSHAKEmust not be set on a client context. This was the original bug. The_set_verify_modehelper prevents this already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for answering these, @tiran. LGTM.
SSLContext.post_handshake_auth = True no longer sets SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the option is documented as ignored for clients, OpenSSL implicitly enables cert chain validation when the flag is set. Signed-off-by: Christian Heimes <christian@python.org>
06c3021 to
83d7c57
Compare
orsenthil
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
|
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.7, 3.8. |
|
I'm having trouble backporting to |
SSLContext.post_handshake_auth = True no longer sets SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the option is documented as ignored for clients, OpenSSL implicitly enables cert chain validation when the flag is set. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue37428 (cherry picked from commit f0f5930) Co-authored-by: Christian Heimes <christian@python.org>
|
GH-14493 is a backport of this pull request to the 3.7 branch. |
|
Sorry, @tiran, I could not cleanly backport this to |
|
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
|
Sorry @tiran, I had trouble checking out the |
…4421) SSLContext.post_handshake_auth = True no longer sets SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the option is documented as ignored for clients, OpenSSL implicitly enables cert chain validation when the flag is set. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue37428 (cherry picked from commit f0f5930) Co-authored-by: Christian Heimes <christian@python.org>
|
GH-14494 is a backport of this pull request to the 3.8 branch. |
…H-14493) SSLContext.post_handshake_auth = True no longer sets SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the option is documented as ignored for clients, OpenSSL implicitly enables cert chain validation when the flag is set. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue37428 (cherry picked from commit f0f5930) Co-authored-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue37428
…4421) (pythonGH-14493) SSLContext.post_handshake_auth = True no longer sets SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the option is documented as ignored for clients, OpenSSL implicitly enables cert chain validation when the flag is set. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue37428 (cherry picked from commit f0f5930) Co-authored-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue37428
SSLContext.post_handshake_auth = True no longer sets SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the option is documented as ignored for clients, OpenSSL implicitly enables cert chain validation when the flag is set. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue37428
SSLContext.post_handshake_auth = True no longer sets SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the option is documented as ignored for clients, OpenSSL implicitly enables cert chain validation when the flag is set. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue37428
SSLContext.post_handshake_auth = True no longer sets
SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the
option is documented as ignored for clients, OpenSSL implicitly enables cert
chain validation when the flag is set.
Signed-off-by: Christian Heimes christian@python.org
https://bugs.python.org/issue37428