-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[DO NOT MERGE] Almost complete rustls integration rewrite #8007
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
Draft
im-0
wants to merge
25
commits into
RustPython:main
Choose a base branch
from
im-0:rustls-integration-rewrite
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+10,017
−9,543
Draft
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ef042f0
Add a test for ssl with ssl.MemoryBIO
im-0 aab1759
Add Serde serializer that converts structs into basic Python objects
im-0 ea88e05
Support module monkey-patching on VM level
im-0 4b663e0
Add OpenSSL data files used to build OID and NID tables
im-0 d2b1496
Enable/disable ssl-related tests from cpython test suite
im-0 6c311f8
Revert "Skip flaky tests (#7961)"
im-0 3f5cb40
Revert "Skip flaky test (#7967)"
im-0 b5a1ea3
Almost a complete rewrite of rustls integration
im-0 d0b2767
Skip test.test_httplib.HTTPSTest.test_networked_good_cert if rustls i…
im-0 814b5cd
On client, both CERT_OPTIONAL and CERT_REQUIRED enable cert verification
im-0 150128f
Rename stdlib_ssl_bio_unencrypted_trailer.py -> stdlib_ssl.py
im-0 196140b
Move crates/stdlib/src/rustls-data -> crates/stdlib/rustls-data
im-0 0332046
Use expectedFailureIf() instead of skipIf() for rustls-specific skips
im-0 fdd514b
Fix `cargo shear` warn (graviola dep for examples/custom_tls_provider…
im-0 6b954ef
Call SNI callback earlier and re-read the context after it
im-0 99d20f8
Remove allow_threads() from rustls integration
im-0 adce18b
Use certs from both SSL_CERT_FILE and SSL_CERT_DIR env vars if present
im-0 6036eaa
Keep rustls error in SslError until converted into Python error
im-0 4e79b93
Ensure that TLS alerts are sent back on TLS errors
im-0 7117204
Document TLS connection state machine
im-0 5e02b75
Test Rust -> Python serializer with py_serde::PyObjectSerializer
im-0 9feac87
Add documentation for Rust -> Python serializer
im-0 c56a8d4
Serialize unit struct into Python string with just a struct name
im-0 21a68f2
Enable ThreadedTests.test_ssl_in_multiple_threads
im-0 8a43b8e
Workaround for test.test_ssl.ThreadedTests.test_wrong_cert_tls*
im-0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
how does this pass before?
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.
If this doesn't crash/hangs Id prefer to have it as
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.
@youknowone There is a hack for a case when server certificate is loaded into a certificate store:
RustPython/crates/stdlib/src/ssl/cert.rs
Line 1594 in c5f555e
It is possible to closer replicate OpenSSL behavior but for this it will better to just fork https://github.com/rustls/webpki instead of adding more hacks around it (I added some too and I do not like it). And it will not work with
rustls_platform_verifieranyway as its behavior is not configurable (whether we need to userustls_platform_verifierat all is a different question).