From 28d68f3d974b24aa2433582b1df3352b1edeb5a0 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 3a904697a7ac80..2395f28c7b8cb7 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1087,7 +1087,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( @@ -1187,13 +1188,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)) {