Skip to content

Commit

Permalink
Fixed implementation for quoneq_net::get_ca_cert() for compliance.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Feb 15, 2025
1 parent c40192d commit 03ade85
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/quoneq/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ void quoneq_net::set_ca_cert(std::string path) {
}

std::string quoneq_net::get_ca_cert() {
char* cacert_path = nullptr;
char* cacert = nullptr;
CURL *curl = curl_easy_init();

if(!curl)
return quoneq_net::cacert_path;

curl_easy_getinfo(curl, CURLINFO_CAINFO, &cacert_path);
if((cacert_path != NULL) && (cacert_path[0] == '\0'))
return cacert_path;
curl_easy_getinfo(curl, CURLINFO_CAINFO, &cacert);
if((cacert != NULL) && (cacert[0] == '\0'))
return std::string(cacert);

return quoneq_net::cacert_path;
}

0 comments on commit 03ade85

Please sign in to comment.