You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fetch() ignores NODE_TLS_REJECT_UNAUTHORIZED, NODE_EXTRA_CA_CERTS and SSL_CERT_FILE — node:https honours all three #9682
perry-stdlib/src/fetch/mod.rs:122 — fetch_client_builder sets no TLS options at all, so fetch() silently ignores NODE_TLS_REJECT_UNAUTHORIZED=0, NODE_EXTRA_CA_CERTS and SSL_CERT_FILE. Meanwhile perry-ext-http/src/tls_client.rs implements all three for node:https — so the two HTTP surfaces disagree, and the one most code reaches for is the one without support.
Practical impact: corporate MITM proxies, self-signed dev endpoints and custom CA bundles all work through node:https and fail through fetch(). (NODE_USE_ENV_PROXY=1 + HTTPS_PROXYdoes work, so proxying is fine — it is only the trust configuration that is missing.)
Fix: mirror tls_client.rs's handling into fetch_client_builder. Better still, factor the three-variable resolution into one shared helper both surfaces call — this is the same drifted-duplicate-knowledge shape as #9498's dispatch table, and a shared resolver prevents the next divergence.
Also noted from the same session and worth a look while in this area: import * as https from "node:https"; https.request(…) produced no output and no error in a minimal fixture (scratchpad/w9673/t3.ts) — possibly a separate defect.
Verification: fixture hitting a local TLS server with a self-signed cert under each variable, comparing fetch() and https.request() against node's behaviour for all three; plus the negative control that an untrusted cert still rejects when no variable is set.
Fixed on main (9c3b2d5513). Verified: fetch_client_builder now calls apply_node_tls_environment, which resolves the environment through a sharedperry_ffi::node_tls_client_environment() rather than re-parsing the three variables — so fetch() and node:https cannot drift apart again, which was the structural half of this issue. Ships with crates/perry/tests/issue_9682_fetch_tls_env.rs (204 lines) and a leaf-cert fixture.
Activity
proggeramlug commentedon Sep 4, 2026
Fixed on main (
9c3b2d5513). Verified:fetch_client_buildernow callsapply_node_tls_environment, which resolves the environment through a sharedperry_ffi::node_tls_client_environment()rather than re-parsing the three variables — sofetch()andnode:httpscannot drift apart again, which was the structural half of this issue. Ships withcrates/perry/tests/issue_9682_fetch_tls_env.rs(204 lines) and a leaf-cert fixture.