Make sure server SSL certificate is also validated when using older versions of

cuRL by setting CURLOPT_SSL_VERIFYPEER to 1.

For explicitness sake, also explicity set CURLOPT_SSL_VERIFYHOST option
to a default value of 2.
This commit is contained in:
Tomaz Muraus 2013-11-17 17:11:25 +01:00
parent 7b9129caca
commit bb512f60c3
1 changed files with 3 additions and 0 deletions

View File

@ -1508,6 +1508,9 @@ CURLcode make_curl_request(const CString& service_host, const CString& service_u
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
}
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2L);
curl_easy_setopt(curl, CURLOPT_URL, url.data());
curl_easy_setopt(curl, CURLOPT_PORT, port);
curl_easy_setopt(curl, CURLOPT_USERAGENT, "ZNC Push");