restclient-cpp icon indicating copy to clipboard operation
restclient-cpp copied to clipboard

void Connection::SetVerifyPeer(bool _verifyPeer) is not usefule to ignore peer verification

Open Jiwangreal opened this issue 1 year ago • 0 comments

In Connection::performCurlRequest Function, you need add the CURLOPT_SSL_VERIFYHOST curl option to avoid peer verification check.

file:connection.cc


old:
    // set peer verification
    if (!this->verifyPeer)
    {
        curl_easy_setopt(
            getCurlHandle(), CURLOPT_SSL_VERIFYPEER, this->verifyPeer);
    }

new

    // set peer verification
    if (!this->verifyPeer)
    {
        curl_easy_setopt(
            getCurlHandle(), CURLOPT_SSL_VERIFYHOST, this->verifyPeer);
        curl_easy_setopt(
            getCurlHandle(), CURLOPT_SSL_VERIFYPEER, this->verifyPeer);
    }

Jiwangreal avatar Apr 19 '24 08:04 Jiwangreal