From 33c91102a58e2fbcf9d7a66e33b41a65fa3f0e0c Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Tue, 16 Jun 2020 00:41:57 +0200 Subject: Adds improved client certificate management, adds server certificate management. --- src/webclient.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/webclient.cpp') 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 &errors) +{ + for(auto const & err : errors) + qDebug() << err; + this->current_reply->ignoreSslErrors(); +} -- cgit v1.2.3