From: Remi Gacogne Date: Fri, 27 Jan 2023 13:47:31 +0000 (+0100) Subject: MiniCurl: Fix building on versions older than 7.43.0 X-Git-Tag: dnsdist-1.8.0-rc1~73^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c390f850ce3bedff25ff32c9dd7fe7061f3ec052;p=thirdparty%2Fpdns.git MiniCurl: Fix building on versions older than 7.43.0 --- diff --git a/pdns/minicurl.cc b/pdns/minicurl.cc index 8ef955ff89..d37cd9e555 100644 --- a/pdns/minicurl.cc +++ b/pdns/minicurl.cc @@ -160,12 +160,14 @@ void MiniCurl::setupURL(const std::string& str, const ComboAddress* rem, const C curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_INTERFACE, src->toString().c_str()); } 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) +#if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM >= 0x075500 // 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);