|
|
|
@ -75,8 +75,9 @@ static const std::string CAFilename = "cacert.pem"; // https://curl.haxx.se/docs
|
|
|
|
|
// ***************************************************************************
|
|
|
|
|
bool CCurlHttpClient::verifyServer(bool verify)
|
|
|
|
|
{
|
|
|
|
|
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYHOST, verify ? 2 : 0);
|
|
|
|
|
m_Verify = verify;
|
|
|
|
|
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYPEER, verify ? 1 : 0);
|
|
|
|
|
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYHOST, verify ? 2 : 0);
|
|
|
|
|
|
|
|
|
|
// specify custom CA certs
|
|
|
|
|
CCurlCertificates::addCertificateFile(CAFilename);
|
|
|
|
@ -97,8 +98,8 @@ bool CCurlHttpClient::sendRequest(const std::string& methodWB, const std::string
|
|
|
|
|
curl_easy_setopt(_Curl, CURLOPT_URL, url.c_str());
|
|
|
|
|
if (url.length() > 8 && (url[4] == 's' || url[4] == 'S')) // 01234 https
|
|
|
|
|
{
|
|
|
|
|
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYPEER, 1L);
|
|
|
|
|
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYHOST, 2L);
|
|
|
|
|
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYPEER, m_Verify ? 1L : 0);
|
|
|
|
|
curl_easy_setopt(_Curl, CURLOPT_SSL_VERIFYHOST, m_Verify ? 2L : 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Authentication
|
|
|
|
|