Skip to content

Commit

Permalink
openssl: replace call to OPENSSL_config
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bagder committed Aug 7, 2014
1 parent 40e1382 commit 7d2f61f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/vtls/openssl.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7d2f61f

Please sign in to comment.