From 2576ed75259ca6bf769758a012cc40c43bcbbc12 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 26 Jan 2023 11:49:35 +0100 Subject: [PATCH] MiniCurl: Stop using the deprecated CURLOPT_PROTOCOLS on curl 7.85+ --- pdns/minicurl.cc | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.47.2