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 @@ -833,13 +833,6 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
833
833
&default_env_options->redirect_warnings );
834
834
}
835
835
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
-
843
836
#if !defined(NODE_WITHOUT_NODE_OPTIONS)
844
837
std::string node_options;
845
838
Original file line number Diff line number Diff line change @@ -6964,30 +6964,19 @@ void TimingSafeEqual(const FunctionCallbackInfo<Value>& args) {
6964
6964
}
6965
6965
6966
6966
void InitCryptoOnce () {
6967
- SSL_load_error_strings ();
6968
- OPENSSL_no_config ();
6967
+ # ifndef OPENSSL_IS_BORINGSSL
6968
+ OPENSSL_INIT_SETTINGS* settings = OPENSSL_INIT_new ();
6969
6969
6970
6970
// --openssl-config=...
6971
6971
if (!per_process::cli_options->openssl_config .empty ()) {
6972
- OPENSSL_load_builtin_modules ();
6973
- #ifndef OPENSSL_NO_ENGINE
6974
- ENGINE_load_builtin_engines ();
6975
- #endif
6976
- ERR_clear_error ();
6977
- CONF_modules_load_file (per_process::cli_options->openssl_config .c_str (),
6978
- nullptr ,
6979
- CONF_MFLAGS_DEFAULT_SECTION);
6980
- int err = ERR_get_error ();
6981
- if (0 != err) {
6982
- fprintf (stderr,
6983
- " openssl config failed: %s\n " ,
6984
- ERR_error_string (err, nullptr ));
6985
- CHECK_NE (err, 0 );
6986
- }
6972
+ const char * conf = per_process::cli_options->openssl_config .c_str ();
6973
+ OPENSSL_INIT_set_config_filename (settings, conf);
6987
6974
}
6988
6975
6989
- SSL_library_init ();
6990
- OpenSSL_add_all_algorithms ();
6976
+ OPENSSL_init_ssl (0 , settings);
6977
+ OPENSSL_INIT_free (settings);
6978
+ settings = nullptr ;
6979
+ #endif
6991
6980
6992
6981
#ifdef NODE_FIPS_MODE
6993
6982
/* Override FIPS settings in cnf file, if needed. */
You can’t perform that action at this time.
0 commit comments