From 0ec4d9d73450220d87615f2d0332214e7df03f72 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 12 Apr 2024 01:29:55 +0200 Subject: [PATCH] crypto: enable NODE_EXTRA_CA_CERTS with BoringSSL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/52217 Reviewed-By: Tobias Nießen Reviewed-By: Richard Lau Reviewed-By: Anna Henningsen Reviewed-By: Yagiz Nizipli Reviewed-By: Luigi Pinca --- src/node.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/node.cc b/src/node.cc index 10e04ed8a28bd0..3e4f1b5d730865 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1079,7 +1079,8 @@ InitializeOncePerProcessInternal(const std::vector& args, } if (!(flags & ProcessInitializationFlags::kNoInitOpenSSL)) { -#if HAVE_OPENSSL && !defined(OPENSSL_IS_BORINGSSL) +#if HAVE_OPENSSL +#ifndef OPENSSL_IS_BORINGSSL auto GetOpenSSLErrorString = []() -> std::string { std::string ret; ERR_print_errors_cb( @@ -1179,13 +1180,13 @@ InitializeOncePerProcessInternal(const std::vector& args, CHECK(crypto::CSPRNG(buffer, length).is_ok()); return true; }); - +#endif // !defined(OPENSSL_IS_BORINGSSL) { 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) +#endif // HAVE_OPENSSL } if (!(flags & ProcessInitializationFlags::kNoInitializeNodeV8Platform)) {