add PIHTTPClient::ignoreSSLErrors()

This commit is contained in:
2026-03-06 20:31:37 +03:00
parent 46f86b6591
commit 07ae277f9e
2 changed files with 12 additions and 0 deletions

View File

@@ -93,6 +93,7 @@ bool PIHTTPClient::init() {
// curl_easy_setopt(PRIVATE->handle, CURLOPT_VERBOSE, 1L);
// curl_easy_setopt(PRIVATE->handle, CURLOPT_ERRORBUFFER, buffer_error.data());
curl_easy_setopt(PRIVATE->handle, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(PRIVATE->handle, CURLOPT_SSL_VERIFYHOST, ignore_ssl_errors ? 0L : 1L);
if (request.body().isNotEmpty()) {
curl_easy_setopt(PRIVATE->handle, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(PRIVATE->handle, CURLOPT_INFILESIZE_LARGE, static_cast<curl_off_t>(request.body().size()));
@@ -273,6 +274,12 @@ PIHTTPClient * PIHTTPClient::onAbort(std::function<void(const PIHTTP::MessageCon
}
PIHTTPClient * PIHTTPClient::ignoreSSLErrors() {
ignore_ssl_errors = true;
return this;
}
void PIHTTPClient::start() {
CurlThreadPool::instance()->registerClient(this);
}