From 7ab0dfc8ce56dacee9206b4c429a6c4bd94394b4 Mon Sep 17 00:00:00 2001 From: jcorporation Date: Tue, 27 Sep 2022 20:05:29 +0200 Subject: [PATCH] Sets the curl proxy ssl verify options to the values of the host configuration options This fixes #1616 --- src/input/plugins/CurlInputPlugin.cxx | 2 ++ src/lib/curl/Request.hxx | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index cc26067149..864ea57fff 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -439,6 +439,8 @@ 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); } void diff --git a/src/lib/curl/Request.hxx b/src/lib/curl/Request.hxx index fcd68ca8e1..ce22f90fb0 100644 --- a/src/lib/curl/Request.hxx +++ b/src/lib/curl/Request.hxx @@ -123,6 +123,14 @@ public: easy.SetVerifyPeer(value); } + void SetProxyVerifyHost(bool value) { + easy.SetOption(CURLOPT_PROXY_SSL_VERIFYHOST, value ? 2L : 0L); + } + + void SetProxyVerifyPeer(bool value) { + easy.SetOption(CURLOPT_PROXY_SSL_VERIFYPEER, value); + } + void SetNoBody(bool value=true) { easy.SetNoBody(value); }