Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5445835

Browse filesBrowse files
ckcr4lyfMoLow
authored andcommitted
src: check node_extra_ca_certs after openssl cfg
I recently discovered that the custom NodeJS specific OpenSSL config section in openssl.cnf would not be respected, if the environment variable `NODE_EXTRA_CA_CERTS` was set. This happens even if it contains an invalid value, i.e no actual certs are read. Someone suggested moving the checking of extra ca certs to after the OpenSSL config is read, and this seems to work. PR-URL: #48159 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent d9a68b8 commit 5445835
Copy full SHA for 5445835

File tree

Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-5
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -969,11 +969,6 @@ std::unique_ptr<InitializationResult> InitializeOncePerProcess(
969969
return ret;
970970
};
971971

972-
{
973-
std::string extra_ca_certs;
974-
if (credentials::SafeGetenv("NODE_EXTRA_CA_CERTS", &extra_ca_certs))
975-
crypto::UseExtraCaCerts(extra_ca_certs);
976-
}
977972
// In the case of FIPS builds we should make sure
978973
// the random source is properly initialized first.
979974
#if OPENSSL_VERSION_MAJOR >= 3
@@ -1058,6 +1053,12 @@ std::unique_ptr<InitializationResult> InitializeOncePerProcess(
10581053
CHECK(crypto::CSPRNG(buffer, length).is_ok());
10591054
return true;
10601055
});
1056+
1057+
{
1058+
std::string extra_ca_certs;
1059+
if (credentials::SafeGetenv("NODE_EXTRA_CA_CERTS", &extra_ca_certs))
1060+
crypto::UseExtraCaCerts(extra_ca_certs);
1061+
}
10611062
#endif // HAVE_OPENSSL && !defined(OPENSSL_IS_BORINGSSL)
10621063
}
10631064

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.