aboutsummaryrefslogtreecommitdiff
path: root/src/webclient.cpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-16 00:41:57 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-16 00:41:57 +0200
commit33c91102a58e2fbcf9d7a66e33b41a65fa3f0e0c (patch)
treea724f0c3dcc48c8ce1f78c2665fe8ef170acb379 /src/webclient.cpp
parent5bb3f3f92e62a0af02fe475943759b8c25cd4592 (diff)
downloadkristall-33c91102a58e2fbcf9d7a66e33b41a65fa3f0e0c.tar.gz
Adds improved client certificate management, adds server certificate management.
Diffstat (limited to 'src/webclient.cpp')
-rw-r--r--src/webclient.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/webclient.cpp b/src/webclient.cpp
index d8e1da5..d73842b 100644
--- a/src/webclient.cpp
+++ b/src/webclient.cpp
@@ -35,6 +35,8 @@ bool WebClient::startRequest(const QUrl &url)
connect(this->current_reply, &QNetworkReply::readyRead, this, &WebClient::on_data);
connect(this->current_reply, &QNetworkReply::finished, this, &WebClient::on_finished);
+ connect(this->current_reply, &QNetworkReply::errorOccurred, this, &WebClient::on_networkError);
+ connect(this->current_reply, &QNetworkReply::sslErrors, this, &WebClient::on_sslErrors);
return true;
}
@@ -71,7 +73,7 @@ void WebClient::on_finished()
{
auto mime = this->current_reply->header(QNetworkRequest::ContentTypeHeader).toString();
- qDebug() << this->current_reply->url() << mime;
+ // qDebug() << this->current_reply->url() << mime;
emit this->requestComplete(this->body, mime);
@@ -80,3 +82,15 @@ void WebClient::on_finished()
this->current_reply->deleteLater();
this->current_reply = nullptr;
}
+
+void WebClient::on_networkError(QNetworkReply::NetworkError code)
+{
+ qDebug() << code << this->current_reply->errorString();
+}
+
+void WebClient::on_sslErrors(const QList<QSslError> &errors)
+{
+ for(auto const & err : errors)
+ qDebug() << err;
+ this->current_reply->ignoreSslErrors();
+}