aboutsummaryrefslogtreecommitdiff
path: root/src/webclient.cpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-19 10:37:20 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-19 10:37:20 +0200
commit6a5198d23412a6d11f78cdef71850e578ca6f8c0 (patch)
tree136afe4f0d78018a1ae97a35e770ae792ae66ebc /src/webclient.cpp
parent9a5c0b8ba8595b9084ad8dc27884b0cbc691459c (diff)
downloadkristall-6a5198d23412a6d11f78cdef71850e578ca6f8c0.tar.gz
Allows user to skip over invalid TLS connections and fetch the content anyways.
Diffstat (limited to 'src/webclient.cpp')
-rw-r--r--src/webclient.cpp8
1 files changed, 7 insertions, 1 deletions
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<QSslError> &errors)
{
+ if(options & IgnoreTlsErrors) {
+ this->current_reply->ignoreSslErrors(errors);
+ return;
+ }
+
qDebug() << "HTTP SSL Errors:";
for(auto const & err : errors)
qDebug() << err;