From a8b0c558188e7095f1ccc7a14705596335975b8d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 28 Nov 2022 15:33:10 +0100 Subject: [PATCH] input/curl: make proxy verify setting optional These settings do not work if CURL was compiled with CURL_DISABLE_PROXY, and cause error "An unknown option was passed in to libcurl". Fixes regression by commit 7ab0dfc8ce56dacee9206b4c429a6c4bd94394b4 --- src/input/plugins/CurlInputPlugin.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index 864ea57ff..e90ce8daf 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -439,8 +439,14 @@ CurlInputStream::InitEasy() request->SetVerifyPeer(verify_peer); request->SetVerifyHost(verify_host); request->SetOption(CURLOPT_HTTPHEADER, request_headers.Get()); - request->SetProxyVerifyPeer(verify_peer); - request->SetProxyVerifyHost(verify_host); + + try { + request->SetProxyVerifyPeer(verify_peer); + request->SetProxyVerifyHost(verify_host); + } catch (...) { + /* these methods fail if libCURL was compiled with + CURL_DISABLE_PROXY; ignore silently */ + } } void