Skip to content

Commit

Permalink
crypto: fix ci failure
Browse files Browse the repository at this point in the history
  • Loading branch information
twitharshil committed Oct 10, 2022
1 parent 0815d61 commit 87a7def
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,7 @@ Node.js options that are allowed are:
* `--no-global-search-paths`
* `--no-warnings`
* `--node-memory-debug`
* `--node-use-system-ca`
* `--openssl-config`
* `--openssl-legacy-provider`
* `--openssl-shared-config`
Expand Down
4 changes: 3 additions & 1 deletion src/crypto/crypto_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx,

void ReadSystemStoreCertificates(
std::vector<std::string>* system_root_certificates) {
#ifdef _WIN32
const HCERTSTORE hStore = CertOpenSystemStoreW(0, L"ROOT");
CHECK_NE(hStore, NULLPTR);
CHECK_NE(hStore, nullptr);

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

system_root_certificates->emplace_back(std::move(base64_string_output));
}
#endif
}

X509_STORE* NewRootCertStore() {
Expand Down
3 changes: 3 additions & 0 deletions test/parallel/test-cli-node-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ if (common.hasCrypto) {
expectNoWorker('--use-bundled-ca', 'B\n');
if (!common.hasOpenSSL3)
expectNoWorker('--openssl-config=_ossl_cfg', 'B\n');
if (common.isWindows) {
expectNoWorker('--node-use-system-ca', 'B\n');
}
}

// V8 options
Expand Down
3 changes: 2 additions & 1 deletion test/parallel/test-cli-node-print-help.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function validateNodePrintHelp() {
{ compileConstant: HAVE_OPENSSL,
flags: [ '--openssl-config=...', '--tls-cipher-list=...',
'--use-bundled-ca', '--use-openssl-ca',
'--enable-fips', '--force-fips' ] },
'--enable-fips', '--force-fips',
common.isWindows ? '--node-use-system-ca' : '' ] },
{ compileConstant: NODE_HAVE_I18N_SUPPORT,
flags: [ '--icu-data-dir=...', 'NODE_ICU_DATA' ] },
{ compileConstant: HAVE_INSPECTOR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const conditionalOpts = [
common.hasOpenSSL3 ? '--openssl-shared-config' : '',
'--tls-cipher-list',
'--use-bundled-ca',
common.isWindows ? '--node-use-system-ca' : '',
'--use-openssl-ca',
'--secure-heap',
'--secure-heap-min',
Expand Down

0 comments on commit 87a7def

Please sign in to comment.