From 81ace51dcd3dcf158f970eca57c45ceaa7e3e8d7 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 7 Mar 2023 17:12:22 +0100 Subject: curl_easy_handle: Add logic for handling user SSL settings --- src/other_tools/utils/curl_easy_handle.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/other_tools/utils/curl_easy_handle.hpp') diff --git a/src/other_tools/utils/curl_easy_handle.hpp b/src/other_tools/utils/curl_easy_handle.hpp index 33bf462e..ea5989a1 100644 --- a/src/other_tools/utils/curl_easy_handle.hpp +++ b/src/other_tools/utils/curl_easy_handle.hpp @@ -49,6 +49,12 @@ class CurlEasyHandle { [[nodiscard]] auto static Create() noexcept -> std::shared_ptr; + /// \brief Create a CurlEasyHandle object with non-default CA info + [[nodiscard]] auto static Create( + bool no_ssl_verify, + std::optional const& ca_bundle) noexcept + -> std::shared_ptr; + /// \brief Download file from URL into given file_path. /// Will perform cleanup (i.e., remove empty file) in case download fails. /// Returns 0 if successful. @@ -68,6 +74,9 @@ class CurlEasyHandle { nullptr, curl_easy_closer}; + bool no_ssl_verify_{false}; + std::optional ca_bundle_{std::nullopt}; + /// \brief Overwrites write_callback to redirect to file instead of stdout. [[nodiscard]] auto static EasyWriteToFile(gsl::owner data, size_t size, -- cgit v1.2.3