diff options
author | Michael Kalinin <kalinin@company.dnevnik.ru> | 2015-09-22 02:49:54 -0400 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2015-09-28 22:47:25 -0400 |
commit | 69b89050d4b824b54449df907bb9f23f80a3c382 (patch) | |
tree | ed7a8f2af36b8ea56bf86ef44007f2b363bdfe78 | |
parent | 963b7bd4f76fd0e19beaa202bf6f5239eb6153a5 (diff) |
openssl: Fix algorithm init
- Change algorithm init to happen after OpenSSL config load.
Additional algorithms may be available due to the user's config so we
initialize the algorithms after the user's config is loaded.
Bug: https://github.com/bagder/curl/issues/447
Reported-by: Denis Feklushkin
-rw-r--r-- | lib/vtls/openssl.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 998ab2bac..1bb99671d 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -702,16 +702,6 @@ int Curl_ossl_init(void) ENGINE_load_builtin_engines(); #endif - /* Lets get nice error messages */ - SSL_load_error_strings(); - - /* Init the global ciphers and digests */ - if(!SSLeay_add_ssl_algorithms()) - return 0; - - OpenSSL_add_all_algorithms(); - - /* OPENSSL_config(NULL); is "strongly recommended" to use but unfortunately that function makes an exit() call on wrongly formatted config files which makes it hard to use in some situations. OPENSSL_config() itself @@ -728,6 +718,15 @@ int Curl_ossl_init(void) CONF_MFLAGS_DEFAULT_SECTION| CONF_MFLAGS_IGNORE_MISSING_FILE); + /* Lets get nice error messages */ + SSL_load_error_strings(); + + /* Init the global ciphers and digests */ + if(!SSLeay_add_ssl_algorithms()) + return 0; + + OpenSSL_add_all_algorithms(); + return 1; } |