diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-03-07 17:12:22 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-03-08 15:50:46 +0100 |
commit | 81ace51dcd3dcf158f970eca57c45ceaa7e3e8d7 (patch) | |
tree | 53f5becf131cc921c024c32698ed449870187f92 /src/other_tools/utils/curl_easy_handle.hpp | |
parent | aaf386931165d003628780c4d914d3bbc9798a38 (diff) | |
download | justbuild-81ace51dcd3dcf158f970eca57c45ceaa7e3e8d7.tar.gz |
curl_easy_handle: Add logic for handling user SSL settings
Diffstat (limited to 'src/other_tools/utils/curl_easy_handle.hpp')
-rw-r--r-- | src/other_tools/utils/curl_easy_handle.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
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<CurlEasyHandle>; + /// \brief Create a CurlEasyHandle object with non-default CA info + [[nodiscard]] auto static Create( + bool no_ssl_verify, + std::optional<std::filesystem::path> const& ca_bundle) noexcept + -> std::shared_ptr<CurlEasyHandle>; + /// \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<std::filesystem::path> ca_bundle_{std::nullopt}; + /// \brief Overwrites write_callback to redirect to file instead of stdout. [[nodiscard]] auto static EasyWriteToFile(gsl::owner<char*> data, size_t size, |