Skip to content

Commit

Permalink
squash: move NewRootCertStore to crypto_context.h
Browse files Browse the repository at this point in the history
  • Loading branch information
danbev committed Oct 18, 2020
1 parent 0ab510b commit f7fd2ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/crypto/crypto_context.cc
Expand Up @@ -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<X509*> root_certs_vector;
static Mutex root_certs_vector_mutex;
Mutex::ScopedLock lock(root_certs_vector_mutex);
Expand Down Expand Up @@ -228,7 +230,6 @@ static X509_STORE* NewRootCertStore() {

return store;
}
} // namespace

void GetRootCertificates(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
Expand Down
2 changes: 2 additions & 0 deletions src/crypto/crypto_context.h
Expand Up @@ -21,6 +21,8 @@ void GetRootCertificates(
void IsExtraRootCertsFileLoaded(
const v8::FunctionCallbackInfo<v8::Value>& args);

X509_STORE* NewRootCertStore();

class SecureContext final : public BaseObject {
public:
~SecureContext() override;
Expand Down
2 changes: 1 addition & 1 deletion test/cctest/test_node_crypto.cc
Expand Up @@ -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"
Expand Down

0 comments on commit f7fd2ec

Please sign in to comment.