diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index 39ba13c43..57b422d69 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -432,8 +432,8 @@ CurlInputStream::InitEasy() StringFormat<1024>("%s:%s", proxy_user, proxy_password).c_str()); - request->SetOption(CURLOPT_SSL_VERIFYPEER, verify_peer ? 1L : 0L); - request->SetOption(CURLOPT_SSL_VERIFYHOST, verify_host ? 2L : 0L); + request->SetVerifyPeer(verify_peer); + request->SetVerifyHost(verify_host); request->SetOption(CURLOPT_HTTPHEADER, request_headers.Get()); } diff --git a/src/lib/curl/Easy.hxx b/src/lib/curl/Easy.hxx index 20e25a5c2..b36274b66 100644 --- a/src/lib/curl/Easy.hxx +++ b/src/lib/curl/Easy.hxx @@ -136,6 +136,14 @@ public: SetOption(CURLOPT_FAILONERROR, (long)value); } + void SetVerifyHost(bool value) { + SetOption(CURLOPT_SSL_VERIFYHOST, value ? 2L : 0L); + } + + void SetVerifyPeer(bool value) { + SetOption(CURLOPT_SSL_VERIFYPEER, (long)value); + } + void SetConnectTimeout(long timeout) { SetOption(CURLOPT_CONNECTTIMEOUT, timeout); } diff --git a/src/lib/curl/Request.hxx b/src/lib/curl/Request.hxx index 654f3f179..e08e58e8c 100644 --- a/src/lib/curl/Request.hxx +++ b/src/lib/curl/Request.hxx @@ -120,6 +120,14 @@ public: easy.SetRequestHeaders(request_headers); } + void SetVerifyHost(bool value) { + easy.SetVerifyHost(value); + } + + void SetVerifyPeer(bool value) { + easy.SetVerifyPeer(value); + } + void SetNoBody(bool value=true) { easy.SetNoBody(value); }