From: Remi Gacogne Date: Thu, 26 Jan 2023 10:49:35 +0000 (+0100) Subject: MiniCurl: Stop using the deprecated CURLOPT_PROTOCOLS on curl 7.85+ X-Git-Tag: dnsdist-1.8.0-rc1~80^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F12478%2Fhead;p=thirdparty%2Fpdns.git MiniCurl: Stop using the deprecated CURLOPT_PROTOCOLS on curl 7.85+ --- diff --git a/pdns/minicurl.cc b/pdns/minicurl.cc index 2a39e6aca8..8ef955ff89 100644 --- a/pdns/minicurl.cc +++ b/pdns/minicurl.cc @@ -161,7 +161,11 @@ void MiniCurl::setupURL(const std::string& str, const ComboAddress* rem, const C } curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_FOLLOWLOCATION, true); /* only allow HTTP and HTTPS */ +#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0) + curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_PROTOCOLS_STR, "http,https"); +#else curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); +#endif curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_SSL_VERIFYPEER, verify); curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_SSL_VERIFYHOST, verify ? 2 : 0); curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_FAILONERROR, true);