-
-
Notifications
You must be signed in to change notification settings - Fork 37
fix: harden HTTPS CA trust, IPv6 verification, and content-encoding parsing #3504
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ec52ce8
fix(test): use local HTTPS server for cleanup resource test
ardatan 00aac2d
fix(test): add node:https TestServer and harden curl CA loading
ardatan 0787f74
fix(test): gate node:https on CA APIs and preserve URL protocol for ipv6
ardatan c21643f
revert: keep fetchCurl CA loading unchanged
ardatan 9217ac6
refactor: trust CAs via tls.getCACertificates in fetchCurl
ardatan f962c78
fix: preserve NODE_EXTRA_CA_CERTS when getCACertificates is unavailable
ardatan 58c1317
docs: note when getCACertificates fallback can be removed
ardatan 64898ed
changeset: document libcurl default CA store alignment
ardatan 7db01c2
docs(test): note Bun may expose setDefaultCACertificates
ardatan 7577dfc
fix(test): support node:https on Deno via openssl CA and createHttpCl…
ardatan 31aa3a0
fix(test): skip node:https on Deno and fix raw http clients for TLS
ardatan d9b2cc4
fix(test): type requestForUrl with http.RequestOptions
ardatan 986456b
fix(test): include ::1 in ephemeral TLS cert SAN for ipv6 tests
ardatan 40265e2
fix(test): soft-skip external HTTPS connectivity errors and clarify C…
ardatan 9ba05b7
fix(test): skip ipv6 checks on node:https due to Node TLS SAN regression
ardatan 350d848
fix(node-fetch): verify IPv6 IP SANs in node-http HTTPS ponyfill
ardatan ed3d981
perf(node-fetch): apply IPv6 SAN workaround only when Node probe fails
ardatan 4ae4e57
perf(node-fetch): probe IPv6 SAN workaround lazily on first HTTPS use
ardatan 8116a51
fix(server): trim Accept-Encoding / Content-Encoding tokens
ardatan 0e0f9a9
fix(test): soft-skip flaky github.com http→https redirect
ardatan acd7830
fix(test): replace github.com redirect with local http→https servers
ardatan 1c03a6e
revert(test): restore intentional github.com http→https redirect check
ardatan 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| '@whatwg-node/node-fetch': patch | ||
| --- | ||
|
|
||
| Align libcurl TLS trust with Node's default CA store. | ||
|
|
||
| When `tls.getCACertificates` is available (Node.js 22.15+ / 23.10+), the libcurl fetch implementation now loads CAs from `tls.getCACertificates('default')` instead of only reading `NODE_EXTRA_CA_CERTS` / `tls.rootCertificates`. That means custom CAs installed with `tls.setDefaultCACertificates(...)`, plus CAs from `NODE_EXTRA_CA_CERTS` when it was set **before** process start, are honored the same way as Node's built-in `https` client. | ||
|
|
||
| On older Node versions (engines still allow `>=18`), behavior is unchanged: `NODE_EXTRA_CA_CERTS` still maps to libcurl `CAINFO`, otherwise the bundled Mozilla roots are used. | ||
|
|
||
| If you previously set `NODE_EXTRA_CA_CERTS` at runtime after the process started, prefer `tls.setDefaultCACertificates([...tls.getCACertificates('default'), ...yourCerts])` on supported Node versions so both Node TLS and libcurl pick up the same store. | ||
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.
Uh oh!
There was an error while loading. Please reload this page.