crypto: Read OpenSSL config before init

The OpenSSL configuration file allows custom crypto engines but those
directives will not be respected if the config file is loaded after
initializing all crypto subsystems. This patch reads the configuration
file first.

PR-URL: https://github.com/nodejs/node/pull/6374
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Stefan Budeanu 2016-04-25 11:14:35 -04:00 committed by James M Snell
parent 92a02d51dc
commit 56b9478f53

View File

@ -5696,10 +5696,10 @@ void ExportChallenge(const FunctionCallbackInfo<Value>& args) {
void InitCryptoOnce() { void InitCryptoOnce() {
OPENSSL_config(NULL);
SSL_library_init(); SSL_library_init();
OpenSSL_add_all_algorithms(); OpenSSL_add_all_algorithms();
SSL_load_error_strings(); SSL_load_error_strings();
OPENSSL_config(NULL);
crypto_lock_init(); crypto_lock_init();
CRYPTO_set_locking_callback(crypto_lock_cb); CRYPTO_set_locking_callback(crypto_lock_cb);