supported config useSSL

This commit is contained in:
wb-hx510875
2020-07-01 14:08:32 +08:00
committed by Axios
parent 8bed6eecc7
commit 5a451d16d4
6 changed files with 31 additions and 2 deletions

View File

@@ -163,8 +163,13 @@ CurlHttpClient::makeRequest(const HttpRequest &request) {
}
curl_easy_setopt(curlHandle_, CURLOPT_URL, url.c_str());
curl_easy_setopt(curlHandle_, CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt(curlHandle_, CURLOPT_SSL_VERIFYHOST, 2L);
if (rejectUnauthorized()) {
curl_easy_setopt(curlHandle_, CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt(curlHandle_, CURLOPT_SSL_VERIFYHOST, 2L);
} else {
curl_easy_setopt(curlHandle_, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curlHandle_, CURLOPT_SSL_VERIFYHOST, 0L);
}
curl_easy_setopt(curlHandle_, CURLOPT_HEADERDATA, &response);
curl_easy_setopt(curlHandle_, CURLOPT_HEADERFUNCTION, recvHeaders);