File tree 2 files changed +8
-26
lines changed
2 files changed +8
-26
lines changed Original file line number Diff line number Diff line change @@ -785,13 +785,6 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
785
785
&default_env_options->redirect_warnings );
786
786
}
787
787
788
- #if HAVE_OPENSSL
789
- std::string* openssl_config = &per_process::cli_options->openssl_config ;
790
- if (openssl_config->empty ()) {
791
- credentials::SafeGetenv (" OPENSSL_CONF" , openssl_config);
792
- }
793
- #endif
794
-
795
788
#if !defined(NODE_WITHOUT_NODE_OPTIONS)
796
789
std::string node_options;
797
790
Original file line number Diff line number Diff line change @@ -6961,30 +6961,19 @@ void TimingSafeEqual(const FunctionCallbackInfo<Value>& args) {
6961
6961
}
6962
6962
6963
6963
void InitCryptoOnce () {
6964
- SSL_load_error_strings ();
6965
- OPENSSL_no_config ();
6964
+ # ifndef OPENSSL_IS_BORINGSSL
6965
+ OPENSSL_INIT_SETTINGS* settings = OPENSSL_INIT_new ();
6966
6966
6967
6967
// --openssl-config=...
6968
6968
if (!per_process::cli_options->openssl_config .empty ()) {
6969
- OPENSSL_load_builtin_modules ();
6970
- #ifndef OPENSSL_NO_ENGINE
6971
- ENGINE_load_builtin_engines ();
6972
- #endif
6973
- ERR_clear_error ();
6974
- CONF_modules_load_file (per_process::cli_options->openssl_config .c_str (),
6975
- nullptr ,
6976
- CONF_MFLAGS_DEFAULT_SECTION);
6977
- int err = ERR_get_error ();
6978
- if (0 != err) {
6979
- fprintf (stderr,
6980
- " openssl config failed: %s\n " ,
6981
- ERR_error_string (err, nullptr ));
6982
- CHECK_NE (err, 0 );
6983
- }
6969
+ const char * conf = per_process::cli_options->openssl_config .c_str ();
6970
+ OPENSSL_INIT_set_config_filename (settings, conf);
6984
6971
}
6985
6972
6986
- SSL_library_init ();
6987
- OpenSSL_add_all_algorithms ();
6973
+ OPENSSL_init_ssl (0 , settings);
6974
+ OPENSSL_INIT_free (settings);
6975
+ settings = nullptr ;
6976
+ #endif
6988
6977
6989
6978
#ifdef NODE_FIPS_MODE
6990
6979
/* Override FIPS settings in cnf file, if needed. */
You can’t perform that action at this time.
0 commit comments