-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-118658: Return consistent types from get_un/verified_chain
in SSLObject
and SSLSocket
#118669
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
I restored my old branch from which I created the original PR #109113. There is one file missing about NEWS, I am not sure if that was removed on purpose or not. |
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.
Seems good to me, since these methods are now documented would it make sense to have a test case?
Why not, it will not hurt. I will add it. |
@matiuszka do you plan to add the test cases soon? I would love to see this PR merged. |
Sorry, I forgot about this issue. I will be available next week, so probably next Monday I will have it ready. |
@sethmlarson, @felixfontein I tried to write tests for it but I am not sure how to start. There are no tests for the SSL module, so there is nothing that I can use to start. I would need a boilerplate code to see how to execute such a test. |
@felixfontein I applied your remarks. |
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.
From my POV this is ready to go. (I have no idea who actually has to approve/merge this though, and how to get it backported to 3.13...)
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 this, LGTM. I'm not a core developer so can't merge this myself, unfortunately.
As far as backporting to 3.13, I'll tag in @Yhg1s. The gist is that this API solidified, but didn't get applied to both places where peer certificates can be fetched. Not backporting this will be confusing to other Python implementations which will start implementing the API now that it's public in 3.13 and potentially leave the APIs in a strange place wrt backwards compatibility. There are only two projects which used these APIs that I'm aware of prior to their public availability and they both should be robust to a backport of this API. |
Thanks @matiuszka for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
… in `SSLObject` and `SSLSocket` (pythonGH-118669) (cherry picked from commit 8ef358d) Co-authored-by: Mateusz Nowak <nowak.mateusz@hotmail.com> Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
GH-123082 is a backport of this pull request to the 3.13 branch. |
…` in `SSLObject` and `SSLSocket` (GH-118669) (#123082) gh-118658: Return consistent types from `get_un/verified_chain` in `SSLObject` and `SSLSocket` (GH-118669) (cherry picked from commit 8ef358d) Co-authored-by: Mateusz Nowak <nowak.mateusz@hotmail.com> Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
… in `SSLObject` and `SSLSocket` (python#118669) Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
… in `SSLObject` and `SSLSocket` (python#118669) Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
Sadly, I think this has to be reverted, as it broke certificate generation script, and doesn't contain any other way to generate cert3.pem: Alternatively, you need to produce a fix to that script that includes correct regeneration of cert3.pem. |
…d_chain` in `SSLObject` and `SSLSocket` (python#118669)" This reverts commit 8ef358d.
@kanavin how about simply disabling the broken test instead of reverting the whole PR? It would be pretty sad if the interface would be re-broken by reverting this. |
I looked at the certs; |
#124598 should fix Lib/test/certdata/make_ssl_certs.py to extract cert3.pem from keycert3.pem. |
|
Fixses inconsistent return types between
SSLObject
andSSLSocket
as described ingh-118656