mirror of
https://github.com/nodejs/node.git
synced 2024-11-22 07:37:56 +01:00
2d52dc3efb
settting -> setting PR-URL: https://github.com/nodejs/node/pull/37469 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Pooja D P <Pooja.D.P@ibm.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
24 lines
946 B
C++
24 lines
946 B
C++
// This simulates specifying the configuration option --openssl-system-ca-path
|
|
// and setting it to a file that does not exist.
|
|
#define NODE_OPENSSL_SYSTEM_CERT_PATH "/missing/ca.pem"
|
|
|
|
#include "crypto/crypto_context.h"
|
|
#include "node_options.h"
|
|
#include "openssl/err.h"
|
|
#include "gtest/gtest.h"
|
|
|
|
/*
|
|
* This test verifies that a call to NewRootCertDir with the build time
|
|
* configuration option --openssl-system-ca-path set to an missing file, will
|
|
* not leave any OpenSSL errors on the OpenSSL error stack.
|
|
* See https://github.com/nodejs/node/issues/35456 for details.
|
|
*/
|
|
TEST(NodeCrypto, NewRootCertStore) {
|
|
node::per_process::cli_options->ssl_openssl_cert_store = true;
|
|
X509_STORE* store = node::crypto::NewRootCertStore();
|
|
ASSERT_TRUE(store);
|
|
ASSERT_EQ(ERR_peek_error(), 0UL) << "NewRootCertStore should not have left "
|
|
"any errors on the OpenSSL error stack\n";
|
|
X509_STORE_free(store);
|
|
}
|