From 7a5e4099974a4444e30299ecab1e7e9baab145e7 Mon Sep 17 00:00:00 2001 From: Anton Thomasson Date: Tue, 16 Nov 2021 19:15:47 +0100 Subject: [PATCH] Respect ignoreSslErrors with cURL --- src/curlworker.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/curlworker.cpp b/src/curlworker.cpp index 7c89806..fcfcae7 100644 --- a/src/curlworker.cpp +++ b/src/curlworker.cpp @@ -1,5 +1,6 @@ #include "curlworker.h" #include "curlrequester.h" +#include "settings.h" #include Q_DECLARE_METATYPE(CURLcode) @@ -22,10 +23,13 @@ CurlWorker::CurlWorker(QUrl addr, void* parent) curl_easy_setopt(_curl, CURLOPT_POST, 1L); curl_easy_setopt(_curl, CURLOPT_READFUNCTION, trampoline); curl_easy_setopt(_curl, CURLOPT_READDATA, parent); - curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(_curl, CURLOPT_SSL_VERIFYPEER, 0L); - curl_easy_setopt(_curl, CURLOPT_SSL_VERIFYHOST, 0L); - curl_easy_setopt(_curl, CURLOPT_SSL_VERIFYSTATUS, 0L); +// curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L); + if(Settings::instance()->ignoreSslErrors()) + { + curl_easy_setopt(_curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(_curl, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(_curl, CURLOPT_SSL_VERIFYSTATUS, 0L); + } _opts = NULL;