File tree Expand file tree Collapse file tree 2 files changed +8
-26
lines changed Expand file tree Collapse file tree 2 files changed +8
-26
lines changed Original file line number Diff line number Diff line change @@ -833,13 +833,6 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
833833 &default_env_options->redirect_warnings );
834834 }
835835
836- #if HAVE_OPENSSL
837- std::string* openssl_config = &per_process::cli_options->openssl_config ;
838- if (openssl_config->empty ()) {
839- credentials::SafeGetenv (" OPENSSL_CONF" , openssl_config);
840- }
841- #endif
842-
843836#if !defined(NODE_WITHOUT_NODE_OPTIONS)
844837 std::string node_options;
845838
Original file line number Diff line number Diff line change @@ -6975,30 +6975,19 @@ void TimingSafeEqual(const FunctionCallbackInfo<Value>& args) {
69756975}
69766976
69776977void InitCryptoOnce () {
6978- SSL_load_error_strings ();
6979- OPENSSL_no_config ();
6978+ # ifndef OPENSSL_IS_BORINGSSL
6979+ OPENSSL_INIT_SETTINGS* settings = OPENSSL_INIT_new ();
69806980
69816981 // --openssl-config=...
69826982 if (!per_process::cli_options->openssl_config .empty ()) {
6983- OPENSSL_load_builtin_modules ();
6984- #ifndef OPENSSL_NO_ENGINE
6985- ENGINE_load_builtin_engines ();
6986- #endif
6987- ERR_clear_error ();
6988- CONF_modules_load_file (per_process::cli_options->openssl_config .c_str (),
6989- nullptr ,
6990- CONF_MFLAGS_DEFAULT_SECTION);
6991- int err = ERR_get_error ();
6992- if (0 != err) {
6993- fprintf (stderr,
6994- " openssl config failed: %s\n " ,
6995- ERR_error_string (err, nullptr ));
6996- CHECK_NE (err, 0 );
6997- }
6983+ const char * conf = per_process::cli_options->openssl_config .c_str ();
6984+ OPENSSL_INIT_set_config_filename (settings, conf);
69986985 }
69996986
7000- SSL_library_init ();
7001- OpenSSL_add_all_algorithms ();
6987+ OPENSSL_init_ssl (0 , settings);
6988+ OPENSSL_INIT_free (settings);
6989+ settings = nullptr ;
6990+ #endif
70026991
70036992#ifdef NODE_FIPS_MODE
70046993 /* Override FIPS settings in cnf file, if needed. */
You can’t perform that action at this time.
0 commit comments