@@ -13,12 +13,14 @@ static size_t write_file_(void *ptr, size_t size, size_t nmemb, FILE *stream) {
13
13
14
14
std::string url_encode (std::string url) {
15
15
CURL *curl_ = curl_easy_init ();
16
+ curl_easy_setopt (curl_, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
16
17
return curl_easy_escape (curl_, url.c_str (), 0 );
17
18
}
18
19
19
20
CURL *API::setup_json_session_ (std::string &addr_path, std::string *response,
20
21
long &http_code, std::string token) {
21
22
CURL *curl_ = curl_easy_init ();
23
+ curl_easy_setopt (curl_, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
22
24
23
25
24
26
if (!token.empty ()) {
@@ -53,6 +55,7 @@ void API::download_file(const ghc::filesystem::path &url,
53
55
54
56
APILogger->debug (" API: Downloading file '{0}' -> '{1}'" , url.string (),
55
57
out_path.string ());
58
+ curl_easy_setopt (curl_, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
56
59
curl_easy_setopt (curl_, CURLOPT_URL, url.c_str ());
57
60
curl_easy_setopt (curl_, CURLOPT_WRITEFUNCTION, write_file_);
58
61
curl_easy_setopt (curl_, CURLOPT_WRITEDATA, file_);
@@ -219,7 +222,7 @@ Json::Value API::post_patch_request(std::string addr_path, Json::Value &post_dat
219
222
headers = curl_slist_append (
220
223
headers, (std::string (" Authorization: token " ) + token).c_str ());
221
224
}
222
-
225
+ curl_easy_setopt (curl_, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
223
226
curl_easy_setopt (curl_, CURLOPT_URL, url_path_.c_str ());
224
227
curl_easy_setopt (curl_, CURLOPT_HTTPHEADER, headers);
225
228
if (PATCH) {
0 commit comments