fix(ext/node): improve node:tls test compatibility#34067
Conversation
|
CI note: the latest |
|
Follow-up CI note: after local validation I made one small test stability fix for Focused validation now passes: The remaining completed CI failure is still |
|
CI follow-up: on latest head The earlier failed job https://github.com/denoland/deno/actions/runs/25875470576/job/76041640412 was on prior SHA |
|
CI diagnosis for the current I prepared a bounded fix in Local validation: |
|
CI follow-up for I applied a bounded fix in Validation passed locally:
|
|
Current CI follow-up on head Current status:
Local validation in this pass: |
|
Current CI/local follow-up on head All latest-head
The remaining PR blocker is CI infrastructure/setup: |
|
Latest CI follow-up on head The previously reported blockers have been superseded on the latest checks:
Review state: no review submissions or review threads are currently present. The PR is mergeable at the git level, but GitHub still reports it blocked while the pending CI jobs finish. |
|
Latest CI follow-up on head All latest checks are now green, including |
|
@fibibot review this pr |
|
@fibibot are you reviewing this one? |
|
|
||
| const nodeOptions = Deno.env.get("NODE_OPTIONS"); | ||
| const args = nodeOptions ? splitNodeOptions(nodeOptions) : []; | ||
| const nodeOptions = globalThis.process?.env?.NODE_OPTIONS ?? |
There was a problem hiding this comment.
This should not re-read mutable runtime state after startup. With this change, user code can mutate process.env.NODE_OPTIONS or process.execArgv after node:tls has loaded and then change TLS defaults such as tls.DEFAULT_MIN_VERSION or default CA selection. Node snapshots these option effects from startup state; for example, setting process.env.NODE_OPTIONS = "--tls-min-v1.0 --use-system-ca" at runtime does not change tls.DEFAULT_MIN_VERSION or tls.getCACertificates("default") in Node. Since this affects protocol and trust-store behavior, we should keep these options sourced from startup/translated options, not live mutable JS state.
|
Pushed a follow-up fix in This centralizes the TLS-related option reads on the existing Validation run locally:
|
|
Pushed Validation:
|
Summary
node:tlsCA certificate handling, including default CA overrides, system CA flags, CA list validation/deduping, andgetCACertificates()default/system/bundled/extra behavior.rejectUnauthorized: falsealign more closely with Node.setKeyCert(), ticket key APIs, and related TLS option plumbing.config.jsonc.Validation
cargo build --bin denocargo fmt --checkdeno fmt --check tests/node_compat/config.jsonccargo test --test node_compat -p node_compat_tests -- 'test-tls-client-verify'cargo test --test node_compat -p node_compat_tests -- 'test-tls-get-ca-certificates'cargo test --test node_compat -p node_compat_tests -- 'test-tls'reports 151 passing and 74 remaining failures across the TLS filter; the remaining failures are existing unsupported TLS clusters.