From 6a5198d23412a6d11f78cdef71850e578ca6f8c0 Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Fri, 19 Jun 2020 10:37:20 +0200 Subject: Allows user to skip over invalid TLS connections and fetch the content anyways. --- src/webclient.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/webclient.cpp') diff --git a/src/webclient.cpp b/src/webclient.cpp index 4babb76..6d23ad3 100644 --- a/src/webclient.cpp +++ b/src/webclient.cpp @@ -21,7 +21,7 @@ bool WebClient::supportsScheme(const QString &scheme) const return (scheme == "https") or (scheme == "http"); } -bool WebClient::startRequest(const QUrl &url) +bool WebClient::startRequest(const QUrl &url, RequestOptions options) { if(url.scheme() != "http" and url.scheme() != "https") return false; @@ -29,6 +29,7 @@ bool WebClient::startRequest(const QUrl &url) if(this->current_reply != nullptr) return true; + this->options = options; this->body.clear(); QSslConfiguration ssl_config; @@ -135,6 +136,11 @@ void WebClient::on_finished() void WebClient::on_sslErrors(const QList &errors) { + if(options & IgnoreTlsErrors) { + this->current_reply->ignoreSslErrors(errors); + return; + } + qDebug() << "HTTP SSL Errors:"; for(auto const & err : errors) qDebug() << err; -- cgit v1.2.3