diff --git a/src/crypto/crypto_context.cc b/src/crypto/crypto_context.cc index 54ea3404b55218..5afb120c612bbc 100644 --- a/src/crypto/crypto_context.cc +++ b/src/crypto/crypto_context.cc @@ -187,7 +187,9 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx, issuer); } -static X509_STORE* NewRootCertStore() { +} // namespace + +X509_STORE* NewRootCertStore() { static std::vector root_certs_vector; static Mutex root_certs_vector_mutex; Mutex::ScopedLock lock(root_certs_vector_mutex); @@ -228,7 +230,6 @@ static X509_STORE* NewRootCertStore() { return store; } -} // namespace void GetRootCertificates(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); diff --git a/src/crypto/crypto_context.h b/src/crypto/crypto_context.h index f6c911f1fad03f..d7c94bd952b88a 100644 --- a/src/crypto/crypto_context.h +++ b/src/crypto/crypto_context.h @@ -21,6 +21,8 @@ void GetRootCertificates( void IsExtraRootCertsFileLoaded( const v8::FunctionCallbackInfo& args); +X509_STORE* NewRootCertStore(); + class SecureContext final : public BaseObject { public: ~SecureContext() override; diff --git a/test/cctest/test_node_crypto.cc b/test/cctest/test_node_crypto.cc index c8bb0577d4def2..c0ce5f25496cd3 100644 --- a/test/cctest/test_node_crypto.cc +++ b/test/cctest/test_node_crypto.cc @@ -2,7 +2,7 @@ // and settting it to a file that does not exist. #define NODE_OPENSSL_SYSTEM_CERT_PATH "/missing/ca.pem" -#include "../../src/crypto/crypto_context.cc" // NOLINT(build/include) +#include "crypto/crypto_context.h" #include "node_options.h" #include "openssl/err.h" #include "gtest/gtest.h"