Skip to content

Commit

Permalink
Try to set both a CA bundle file and directory
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAssassin committed May 5, 2024
1 parent 1ac7359 commit e7c0ca0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/appimagetool_fetch_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,17 @@ class GetRequest {
#warning "libcurl version too old, not trying to use default values for system-provided CA certificate bundles"
#endif

bool found = false;

{
const auto chainFile = findCaBundleFile();
if (!chainFile.empty()) {
if (verbose) {
std::cerr << "Using CA bundle file in " << chainFile << std::endl;
}
setOption(CURLOPT_CAINFO, chainFile.c_str());
return;
}
found = true;
}

{
Expand All @@ -190,11 +192,13 @@ class GetRequest {
std::cerr << "Using CA bundle file in " << chainDir << std::endl;
}
setOption(CURLOPT_CAINFO, chainDir.c_str());
return;
}
found = true;
}

std::cerr << "Warning: could not find valid CA chain bundle, HTTPS requests will likely fail" << std::endl;
if (!found) {
std::cerr << "Warning: could not find valid CA chain bundle, HTTPS requests will likely fail" << std::endl;
}
}

public:
Expand Down

0 comments on commit e7c0ca0

Please sign in to comment.