From c390f850ce3bedff25ff32c9dd7fe7061f3ec052 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 27 Jan 2023 14:47:31 +0100 Subject: [PATCH] MiniCurl: Fix building on versions older than 7.43.0 --- pdns/minicurl.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.47.2