From 57e1d60257de85d2813fc24448b6fb4ab0d61f35 Mon Sep 17 00:00:00 2001 From: vogel76 Date: Tue, 3 Jun 2014 17:03:28 +0200 Subject: [PATCH] [BW]: [Fix] Looks like OpenSSL_config argument doesn't refer to configuration file path, which can be passed only through environment variable unfortunetly. --- src/crypto/openssl.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/crypto/openssl.cpp b/src/crypto/openssl.cpp index 82e453c..876116c 100644 --- a/src/crypto/openssl.cpp +++ b/src/crypto/openssl.cpp @@ -4,6 +4,7 @@ #include +#include #include namespace fc @@ -15,8 +16,16 @@ namespace fc { ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); + const boost::filesystem::path& boostPath = _configurationFilePath; - OPENSSL_config(boostPath.empty() ? nullptr : _configurationFilePath.to_native_ansi_path().c_str()); + if(boostPath.empty() == false) + { + std::string varSetting("OPENSSL_CONF="); + varSetting += _configurationFilePath.to_native_ansi_path(); + putenv(varSetting.c_str()); + } + + OPENSSL_config(nullptr); } ~openssl_scope()