Skip to content

Commit a1c8ab6

Browse files
committed
fixup! crypto: support --use-system-ca on Windows
1 parent faf7592 commit a1c8ab6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

doc/api/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3716,9 +3716,9 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
37163716

37173717
[#42511]: https://github.com/nodejs/node/issues/42511
37183718
[Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/
3719+
[Chromium's policy for locally trusted certificates]: https://chromium.googlesource.com/chromium/src/+/main/net/data/ssl/chrome_root_store/faq.md#does-the-chrome-certificate-verifier-consider-local-trust-decisions
37193720
[CommonJS]: modules.md
37203721
[CommonJS module]: modules.md
3721-
[Chromium's policy for locally trusted certificates]: https://chromium.googlesource.com/chromium/src/+/main/net/data/ssl/chrome_root_store/faq.md#does-the-chrome-certificate-verifier-consider-local-trust-decisions
37223722
[DEP0025 warning]: deprecations.md#dep0025-requirenodesys
37233723
[ECMAScript module]: esm.md#modules-ecmascript-modules
37243724
[EventSource Web API]: https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events

src/crypto/crypto_context.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,12 @@ void GatherCertsForLocation(std::vector<X509Pointer>* vector,
611611
location | CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_READONLY_FLAG;
612612

613613
HCERTSTORE opened_store(
614-
CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, NULL, flags, store_name));
614+
CertOpenStore(CERT_STORE_PROV_SYSTEM,
615+
0,
616+
// The Windows API only accepts NULL for hCryptProv.
617+
NULL, /* NOLINT (readability/null_usage) */
618+
flags,
619+
store_name));
615620
if (!opened_store) {
616621
return;
617622
}

0 commit comments

Comments
 (0)