Skip to content

Commit 87a7def

Browse files
committed
crypto: fix ci failure
1 parent 0815d61 commit 87a7def

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

doc/api/cli.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,6 +1839,7 @@ Node.js options that are allowed are:
18391839
* `--no-global-search-paths`
18401840
* `--no-warnings`
18411841
* `--node-memory-debug`
1842+
* `--node-use-system-ca`
18421843
* `--openssl-config`
18431844
* `--openssl-legacy-provider`
18441845
* `--openssl-shared-config`

src/crypto/crypto_context.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,9 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx,
199199

200200
void ReadSystemStoreCertificates(
201201
std::vector<std::string>* system_root_certificates) {
202+
#ifdef _WIN32
202203
const HCERTSTORE hStore = CertOpenSystemStoreW(0, L"ROOT");
203-
CHECK_NE(hStore, NULLPTR);
204+
CHECK_NE(hStore, nullptr);
204205

205206
auto cleanup =
206207
OnScopeLeave([hStore]() { CHECK_EQ(CertCloseStore(hStore, 0), TRUE); });
@@ -254,6 +255,7 @@ void ReadSystemStoreCertificates(
254255

255256
system_root_certificates->emplace_back(std::move(base64_string_output));
256257
}
258+
#endif
257259
}
258260

259261
X509_STORE* NewRootCertStore() {

test/parallel/test-cli-node-options.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ if (common.hasCrypto) {
6464
expectNoWorker('--use-bundled-ca', 'B\n');
6565
if (!common.hasOpenSSL3)
6666
expectNoWorker('--openssl-config=_ossl_cfg', 'B\n');
67+
if (common.isWindows) {
68+
expectNoWorker('--node-use-system-ca', 'B\n');
69+
}
6770
}
6871

6972
// V8 options

test/parallel/test-cli-node-print-help.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ function validateNodePrintHelp() {
2727
{ compileConstant: HAVE_OPENSSL,
2828
flags: [ '--openssl-config=...', '--tls-cipher-list=...',
2929
'--use-bundled-ca', '--use-openssl-ca',
30-
'--enable-fips', '--force-fips' ] },
30+
'--enable-fips', '--force-fips',
31+
common.isWindows ? '--node-use-system-ca' : '' ] },
3132
{ compileConstant: NODE_HAVE_I18N_SUPPORT,
3233
flags: [ '--icu-data-dir=...', 'NODE_ICU_DATA' ] },
3334
{ compileConstant: HAVE_INSPECTOR,

test/parallel/test-process-env-allowed-flags-are-documented.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const conditionalOpts = [
5959
common.hasOpenSSL3 ? '--openssl-shared-config' : '',
6060
'--tls-cipher-list',
6161
'--use-bundled-ca',
62+
common.isWindows ? '--node-use-system-ca' : '',
6263
'--use-openssl-ca',
6364
'--secure-heap',
6465
'--secure-heap-min',

0 commit comments

Comments
 (0)