From 008eacef69bb09724e07f1891dd148b510cb881d Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 30 Jun 2023 16:30:44 +0200 Subject: [PATCH] [curl] no verify --- src/protocol/curl/http.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/protocol/curl/http.c b/src/protocol/curl/http.c index 714bb40d..1242ef32 100644 --- a/src/protocol/curl/http.c +++ b/src/protocol/curl/http.c @@ -179,6 +179,7 @@ do_http(struct connection *conn) if (curl) { CURLMcode rc; char *optstr; + int no_verify = get_blacklist_flags(conn->uri) & SERVER_BLACKLIST_NO_CERT_VERIFY; http->easy = curl; curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite); @@ -280,6 +281,11 @@ do_http(struct connection *conn) } } + if (no_verify) { + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); + } + rc = curl_multi_add_handle(g.multi, curl); mcode_or_die("new_conn: curl_multi_add_handle", rc); }