Added OpenSSL configuration file path. (qt_wallet issue #10 Some clients on Windows 7 quit/crash on start)

This commit is contained in:
PaulEU 2014-07-23 00:18:09 +02:00
parent 2d51fd7321
commit 4890351b34
4 changed files with 18 additions and 3 deletions

View file

@ -58,7 +58,7 @@ namespace fc
/** Allows to explicitly specify OpenSSL configuration file path to be loaded at OpenSSL library init.
If not set OpenSSL will try to load the conf. file (openssl.cnf) from the path it was
configured with what caused serious Keyhotee startup bugs on some Win7 machines.
configured with what caused serious Keyhotee startup bugs on some Win7, Win8 machines.
\warning to be effective this method should be used before any part using OpenSSL, especially
before init_openssl call
*/

View file

@ -165,6 +165,9 @@ namespace fc {
*/
const path& app_path();
/** @return application executable path */
const fc::path& current_path();
class variant;
void to_variant( const fc::path&, fc::variant& );
void from_variant( const fc::variant& , fc::path& );

View file

@ -49,7 +49,13 @@ namespace fc
int init_openssl()
{
static openssl_scope ossl;
return 0;
auto strAppDir = current_path();
fc::path appDir(strAppDir);
fc::path openSSLConf = appDir / "openssl.cnf";
if (fc::exists(openSSLConf))
fc::store_configuration_path(openSSLConf);
static openssl_scope ossl;
return 0;
}
}

View file

@ -421,4 +421,10 @@ namespace fc {
#endif
return appdir;
}
const fc::path& current_path()
{
static fc::path appCurrentPath = boost::filesystem::current_path();
return appCurrentPath;
}
}