GeezerVison is showing github.com — Honor scalar conversion protocols across SSL backends by youknowdot · Pull Request #9653 · RustPython/RustPython
Conversation
youknowdot
commented
Nov 3, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Reuse the existing conversion wrappers for Python 3.15 SSL argument contracts across the OpenSSL, native rustls, WASM shim and browser backends.
- Use
ArgIntoBool for active boolean arguments and setters, including wrapping, certificate formats, hostname checks and supported post-handshake-auth/group options.
- Use
ArgIntoFloat for RAND_add entropy, including __float__, __index__ fallback and float-subclass handling.
- Validate
RAND_add input with ArgStrOrBytesLike even where entropy injection is a no-op.
- Extract converted scalars once before state changes, retaining existing argument kinds and False defaults.
- Promote browser WASM
verify_mode from CERT_NONE to CERT_REQUIRED when enabling hostname checks, preserving other verification modes.
The conversion behavior follows CPython 3.15's SSL Clinic wrappers. No new parser, conversion framework, test or workflow changes are included. Existing shared binder error precedence and string-encoding behavior are outside this patch's scope.
Validation
- Strict Clippy passed for
rustpython-stdlib --lib --features ssl-rustls,threading.
cargo check passed for rustpython-stdlib --lib --features ssl-openssl,threading, using OpenSSL 3.5.7.
- OpenSSL strict Clippy reports 41 preexisting diagnostics. The same messages and source expressions reproduce on unmodified base
94a2b2d511; no new diagnostic was found.
- Formatting, diff checks and independent source review passed.
- An independent 50-case CPython 3.15.0 reference probe confirmed truth/float callbacks, exception propagation, buffer-first validation and float-subclass behavior. This is reference evidence, not RustPython runtime testing.
Review follow-up (42a9891f17): cargo check --locked -p rustpython_wasm --target wasm32-unknown-unknown and focused cargo clippy --no-deps passed with warnings on unchanged code. Dependency-inclusive WASM Clippy stops at two disallowed filesystem calls in unchanged crates/vm/src/getpath.rs.
Local validation is compile/source-only. RustPython runtime, browser runtime, full-workspace and C-API tests remain unrun locally. Existing Lib/test/test_ssl.py coverage is unchanged.
AI assistance: implementation and review used OpenAI Codex; model version was not exposed.
Summary by CodeRabbit
- Bug Fixes
- SSL-related options now consistently accept values convertible to booleans, including options for hostname checking, certificate output, and socket configuration.
RAND_add now accepts string- or bytes-like input and values convertible to floating-point numbers for its entropy argument.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
Reuse shared truth, float and bytes-like argument conversion without per-function parsing or changing backend policy.
Assisted-by: OpenAI Codex:model version not exposed
coderabbitai
Bot
commented
Nov 3, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Caution
Review failed
The pull request is closed.
Walkthrough
-
SSL argument parsing now converts selected boolean, float, and string-or-bytes-like inputs across OpenSSL, SSL, and WebAssembly implementations. Existing setter, socket-wrapping, and certificate-query logic uses the converted values.
Changes: SSL Argument Conversions
| Layer / File(s) |
Summary |
RAND_add input conversion crates/stdlib/src/openssl.rs, crates/stdlib/src/ssl.rs, crates/stdlib/src/ssl_wasm.rs, crates/wasm/src/ssl.rs |
RAND_add parses its data as string-or-bytes-like input and its entropy as a float-convertible value. The non-OpenSSL implementation retains its no-op body. |
SSL setters and socket wrapping crates/stdlib/src/openssl.rs, crates/stdlib/src/ssl.rs, crates/stdlib/src/ssl_wasm.rs, crates/wasm/src/ssl.rs |
Context setters and socket or BIO wrapping convert selected arguments to bool before applying existing logic. The WebAssembly BIO path converts the optional server_side value once and defaults it to false. |
Certificate and group query flags crates/stdlib/src/openssl.rs, crates/stdlib/src/ssl.rs, crates/stdlib/src/ssl_wasm.rs, crates/wasm/src/ssl.rs |
Certificate representation flags and the OpenSSL group-alias flag use boolean conversion. Existing false defaults remain in place. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
Suggested reviewers: youknowone
Merge Risk: Minimal · previous review 3795e
-
The scalar-conversion changes have no established merge-blocking regression. The browser backend still needs the reported certificate-verification correction, but that underlying defect predates this change.
Pre-merge checks: 4 · 1
-
Failed checks: 1 warning
| Check name |
Status |
Explanation |
Resolution |
| Docstring Coverage |
 |
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… |
Write docstrings for the functions missing them to satisfy the coverage threshold. |
Passed checks: 4 passed
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
 |
The title clearly and concisely describes the main change: applying scalar conversion protocols across the SSL backends. |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 14 functions across 4 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-04T12:41:03.448296Z |
3795e64 |
Draft marked ready |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Promote CERT_NONE to CERT_REQUIRED when enabling hostname checks in the browser backend, matching CPython and the other SSL backends. Preserve explicit verification modes and leave them unchanged when disabling hostname checks.
Assisted-by: OpenAI Codex:model version not exposed
Uh oh!
There was an error while loading. Please reload this page.
Merging this PR will not alter performance
✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1
Comparing youknowdot:fix/ssl-native-converters-20261103 (42a9891) with main (0abb21a)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|