From effa850337c4c1e243825255db605ac4b834b6ab Mon Sep 17 00:00:00 2001 From: MihailRis Date: Thu, 10 Sep 2026 21:08:12 +0300 Subject: [PATCH] add HttpRequest::verifySSL --- src/network/Curl.cpp | 4 +++- src/network/commons.hpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/network/Curl.cpp b/src/network/Curl.cpp index 55e98988b..ca64f43f3 100644 --- a/src/network/Curl.cpp +++ b/src/network/Curl.cpp @@ -71,10 +71,12 @@ public: hs = curl_slist_append(hs, header.c_str()); } + curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, request.body.length()); if (!request.body.empty()) { - curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, request.body.length()); curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, request.body.data()); } + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, request.verifySSL); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, request.verifySSL); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, hs); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, request.followLocation); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback); diff --git a/src/network/commons.hpp b/src/network/commons.hpp index 614821404..46745bfbb 100644 --- a/src/network/commons.hpp +++ b/src/network/commons.hpp @@ -26,6 +26,7 @@ namespace network { OnResponse onResponse; OnReject onReject; bool followLocation = false; + bool verifySSL = true; long maxSize = -1; };