]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: replace call to OPENSSL_config
authorDaniel Stenberg <daniel@haxx.se>
Thu, 7 Aug 2014 10:02:34 +0000 (12:02 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 7 Aug 2014 10:40:31 +0000 (12:40 +0200)
OPENSSL_config() 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 calls
CONF_modules_load_file() and we use that instead and we ignore its
return code!

Reported-by: Jan Ehrhardt
Bug: http://curl.haxx.se/bug/view.cgi?id=1401

lib/vtls/openssl.c

index fa879d97492a7a60775cd5c162596077e357d742..62d86c01713768df9c782e0f5c68495950dcc7d0 100644 (file)
@@ -741,7 +741,17 @@ int Curl_ossl_init(void)
     return 0;
 
   OpenSSL_add_all_algorithms();
-  OPENSSL_config(NULL);
+
+
+  /* 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
+     calls CONF_modules_load_file() and we use that instead and we ignore
+     its return code! */
+
+  (void)CONF_modules_load_file(NULL, NULL,
+                               CONF_MFLAGS_DEFAULT_SECTION|
+                               CONF_MFLAGS_IGNORE_MISSING_FILE);
 
   return 1;
 }