Commit eecec247 authored by Ashot's avatar Ashot
Browse files

Fixed ca bundle path

parent 6364b429
Showing with 10 additions and 4 deletions
+10 -4
......@@ -6,7 +6,7 @@ $(package)_dependencies=openssl
$(package)_sha256_hash=1a084da1edbfc3bd632861358b26af45ba91aaadfb15d6482de55748b8dfc693
define $(package)_set_vars
$(package)_config_opts+= --with-ssl=$(host_prefix) --without-librtmp --with-ca-bundle=curl-ca-bundle.crt --disable-shared
$(package)_config_opts+= --with-ssl=$(host_prefix) --without-librtmp --disable-shared
endef
define $(package)_preprocess_cmds
......
......@@ -29,7 +29,8 @@ Updater::Updater() :
stopDownload(false),
testnetUrl("https://raw.githubusercontent.com/Crowndev/crowncoin/master/update_testnet.json"),
//mainnetUrl("https://raw.githubusercontent.com/Crowndev/crowncoin/master/update.json")
mainnetUrl("https://raw.githubusercontent.com/ashotkhachatryan/crowncoin/systemnode/update1.json")
mainnetUrl("https://raw.githubusercontent.com/ashotkhachatryan/crowncoin/systemnode/update1.json"),
caBundle("curl-ca-bundle.crt")
{
}
......@@ -104,12 +105,16 @@ void Updater::SetJsonPath()
void Updater::SetCAPath(CURL* curl)
{
curl_easy_setopt(curl, CURLOPT_CAINFO, caBundle.c_str());
#ifdef __linux__
path app = strprintf("/proc/%s/exe", getpid());
if (exists(app) && is_symlink(app))
{
path appPath = canonical(app).parent_path();
curl_easy_setopt(curl, CURLOPT_CAPATH, appPath);
path appPath = canonical(app).parent_path() / caBundle;
if (exists(appPath))
{
curl_easy_setopt(curl, CURLOPT_CAINFO, appPath.string().c_str());
}
}
#endif
}
......
......@@ -60,6 +60,7 @@ private:
Value jsonData;
const std::string testnetUrl;
const std::string mainnetUrl;
const std::string caBundle;
private:
bool LoadUpdateInfo();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment