[BW]: [Fix] Looks like OpenSSL_config argument doesn't refer to configuration file path, which can be passed only through environment variable unfortunetly.
This commit is contained in:
parent
3e4f4b0d4c
commit
57e1d60257
1 changed files with 10 additions and 1 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include <boost/filesystem/path.hpp>
|
#include <boost/filesystem/path.hpp>
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
|
|
@ -15,8 +16,16 @@ namespace fc
|
||||||
{
|
{
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
OpenSSL_add_all_algorithms();
|
OpenSSL_add_all_algorithms();
|
||||||
|
|
||||||
const boost::filesystem::path& boostPath = _configurationFilePath;
|
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()
|
~openssl_scope()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue