diff --git a/src/node.cc b/src/node.cc index acab0cb3d960b6..b29dc57d6011b5 100644 --- a/src/node.cc +++ b/src/node.cc @@ -961,11 +961,6 @@ InitializeOncePerProcessInternal(const std::vector& args, return ret; }; - { - std::string extra_ca_certs; - if (credentials::SafeGetenv("NODE_EXTRA_CA_CERTS", &extra_ca_certs)) - crypto::UseExtraCaCerts(extra_ca_certs); - } // In the case of FIPS builds we should make sure // the random source is properly initialized first. #if OPENSSL_VERSION_MAJOR >= 3 @@ -1052,6 +1047,12 @@ InitializeOncePerProcessInternal(const std::vector& args, CHECK(crypto::CSPRNG(buffer, length).is_ok()); return true; }); + + { + std::string extra_ca_certs; + if (credentials::SafeGetenv("NODE_EXTRA_CA_CERTS", &extra_ca_certs)) + crypto::UseExtraCaCerts(extra_ca_certs); + } #endif // HAVE_OPENSSL && !defined(OPENSSL_IS_BORINGSSL) }