GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||
GeezerVison is showing github.com — bpo-34670: Add TLS 1.3 post handshake auth by tiran · Pull Request #9460 · python/cpython Conversation
|
|
Technically this is a new feature. However we need the new feature in older releases. Otherwise HTTP clients cannot enable PHA and therefore won't work with mod_ssl and other services that conditionally request TLS client cert auth based on HTTP method or path. Yury, you may need to add the verify_client_post_handshake method to asyncio's SSL support. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
cc @fantix |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
(trivial) typo s/is/it
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed
Sorry, something went wrong.
There was an error while loading. Please reload this page.
What kind of API do we need to add? Is it a new function or a new keyword argument? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ah, I think it will be a new method as (In addition, I'm thinking about whether it is useful to actually wait for the client certificate and return the verification result instead.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
So what object will get the new method? Loop or Server or something else? I think we need a new issue with a design for this ;) @tiran any advice? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think it'll be the SSL transport object |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Alright, that makes sense.
I think we should land this PR and open a new bugs.python.org to discuss new asyncio API. Also cc @asvetlov |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
In principle, I am OK with backporting this to 3.7.x and 3.6.x (as long as it does not introduce any user-visible incompatibilities) since it is in the special category of network security best practices. I do think it should go into master first and get some buildbot exposure, preferably with all three current OpenSSL levels we support (to make sure we don't break 1.0.2x and 1.1.0x), before backporting to maintenance branches. So I don't think we should try to push this into the imminent 3.7.1 and 3.6.7 releases. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
2fa4e8b to
5e53cd9
Compare
|
I have fixed the typo, enhanced the documentation and added more test cases. For now I'd just add the method call to the transport. As @fantix pointed out, the method doesn't perform any IO by itself. A typical scenario may looks like this
(Note, I'm not fully sure that I got the HTTP part right.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
241c9f6 to
397ef68
Compare
|
@1st1 I updated the documentation and added a whatsnew. Please review my PR again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Makes sense.
Another option would be to use I assume this is going to be a new API in 3.8, or do we need to backport this new API to 3.6/3.7? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Does it raise an error if it's not TLS 1.3?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does raise an error if any precondition isn't met (not TLS 1.3, called on client side, PHA not enabled, before or during handshake, ...).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Do you want to always expose the method but raise NotImplementedError if no TLS 1.3 is available?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
ditto
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@1st1 I changed the implementation as requested. The property and method are now always available. Without TLS 1.3, the property is read-only and returns None, the method raises NotImplementedError. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
66895eb to
91d1a3b
Compare
Add SSLContext.post_handshake_auth and SSLSocket.verify_client_post_handshake for TLS 1.3 post-handshake authentication. Signed-off-by: Christian Heimes <[email protected]>
91d1a3b to
8418bf5
Compare
|
Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.6, 3.7. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @tiran, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @tiran, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @tiran, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-9505 is a backport of this pull request to the 3.7 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add SSLContext.post_handshake_auth and SSLSocket.verify_client_post_handshake for TLS 1.3 post-handshake authentication. Signed-off-by: Christian Heimes <[email protected]>q https://bugs.python.org/issue34670. (cherry picked from commit 9fb051f) Co-authored-by: Christian Heimes <[email protected]>
Add SSLContext.post_handshake_auth and SSLSocket.verify_client_post_handshake for TLS 1.3 post-handshake authentication. Signed-off-by: Christian Heimes <[email protected]>q https://bugs.python.org/issue34670. (cherry picked from commit 9fb051f) Co-authored-by: Christian Heimes <[email protected]>
|
GH-9507 is a backport of this pull request to the 3.6 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Add SSLContext.post_handshake_auth and SSLSocket.verify_client_post_handshake for TLS 1.3 post-handshake authentication. Signed-off-by: Christian Heimes <[email protected]>q https://bugs.python.org/issue34670. (cherry picked from commit 9fb051f) Co-authored-by: Christian Heimes <[email protected]> https://bugs.python.org/issue34670
Add SSLContext.post_handshake_auth and SSLSocket.verify_client_post_handshake for TLS 1.3 post-handshake authentication. Signed-off-by: Christian Heimes <[email protected]>q https://bugs.python.org/issue34670. (cherry picked from commit 9fb051f) Co-authored-by: Christian Heimes <[email protected]> https://bugs.python.org/issue34670
There was an error while loading. Please reload this page.
|
FYI I created bpo-34847 to track the discussion of asyncio PHA. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.