From 6ccaad053ce6f44dd31c55055ca9db040f3349c3 Mon Sep 17 00:00:00 2001
From: Dmitry Falko <dfalko@digiflak.com>
Date: Mon, 2 Jun 2014 15:57:12 +0400
Subject: [PATCH] Fix known bug #83 Load OpenSSL default config file

NOWN_BUG #83 curl is unable to load non-default
openssl engines, because openssl isn't initialized
properly. Add CONF_modules_load_file  to initialize
OpenSSL properly.
---
 lib/vtls/openssl.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 68c1067..5a94b5a 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -729,7 +729,13 @@ static char *SSL_strerror(unsigned long error, char *buf, size_t size)
 int Curl_ossl_init(void)
 {
 #ifdef HAVE_ENGINE_LOAD_BUILTIN_ENGINES
+  OPENSSL_load_builtin_modules();
+
   ENGINE_load_builtin_engines();
+
+  if(CONF_modules_load_file(NULL, NULL, 
+    CONF_MFLAGS_DEFAULT_SECTION|CONF_MFLAGS_IGNORE_MISSING_FILE) <= 0)
+    return 0;
 #endif
 
   /* Lets get nice error messages */
-- 
1.7.9.5

