mirror of
https://github.com/HowardHinnant/date.git
synced 2025-01-14 09:47:57 +08:00
Fixes CURLE_SSL_CACERT (60) when downloading tzdata2017c.tar.gz
This commit is contained in:
parent
d3b8d4af8d
commit
5653e9e3a9
@ -2786,6 +2786,7 @@ download_to_string(const std::string& url, std::string& str)
|
||||
};
|
||||
curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, write_cb);
|
||||
curl_easy_setopt(curl.get(), CURLOPT_WRITEDATA, &str);
|
||||
curl_easy_setopt(curl.get(), CURLOPT_SSL_VERIFYPEER, false);
|
||||
auto res = curl_easy_perform(curl.get());
|
||||
return (res == CURLE_OK);
|
||||
}
|
||||
@ -2804,6 +2805,7 @@ download_to_file(const std::string& url, const std::string& local_filename,
|
||||
if (!curl)
|
||||
return false;
|
||||
curl_easy_setopt(curl.get(), CURLOPT_URL, url.c_str());
|
||||
curl_easy_setopt(curl.get(), CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_write_callback write_cb = [](char* contents, std::size_t size, std::size_t nmemb,
|
||||
void* userp) -> std::size_t
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user