diff options
author | Galen Guyer <galen@galenguyer.com> | 2023-05-01 21:21:09 -0400 |
---|---|---|
committer | Galen Guyer <galen@galenguyer.com> | 2023-05-01 21:21:09 -0400 |
commit | 667ec25afc0148c3ca1cef51d7f3bacf08cf6ec2 (patch) | |
tree | 58d5484b600e54069a9de8ff34269811d98b3b9c | |
parent | 3e59bd745e3cd56736494a942c84e9d716cdb916 (diff) |
Add clearcutSslVerifyDisable root optclearcut
-rw-r--r-- | plugins/clearcut_uploader/clearcut_uploader.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/clearcut_uploader/clearcut_uploader.cc b/plugins/clearcut_uploader/clearcut_uploader.cc index 158ffbb8..83d66fff 100644 --- a/plugins/clearcut_uploader/clearcut_uploader.cc +++ b/plugins/clearcut_uploader/clearcut_uploader.cc @@ -18,6 +18,7 @@ struct Clearcut_System_Key { struct Clearcut_Uploader_Data { std::vector<Clearcut_System_Key> keys; std::string clearcut_server; + bool ssl_verify_disable; }; class Clearcut_Uploader : public Plugin_Api { @@ -195,6 +196,11 @@ public: curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response_buffer); + if (this->data.ssl_verify_disable) { + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); + } + curl_multi_add_handle(multi_handle, curl); curl_multi_perform(multi_handle, &still_running); @@ -312,6 +318,12 @@ public: BOOST_LOG_TRIVIAL(error) << "Unable to parse Server URL\n"; return 1; } + + this->data.ssl_verify_disable = cfg.get<bool>("clearcutSslVerifyDisable", false); + if (this->data.ssl_verify_disable) { + BOOST_LOG_TRIVIAL(info) << "ClearCut SSL Verify Disabled"; + } + // Gets the API key for each system, if defined BOOST_FOREACH (boost::property_tree::ptree::value_type &node, cfg.get_child("systems")) { boost::optional<boost::property_tree::ptree &> clearcut_exists = node.second.get_child_optional("clearcutApiKey"); |