diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-16 00:41:57 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-16 00:41:57 +0200 |
| commit | 33c91102a58e2fbcf9d7a66e33b41a65fa3f0e0c (patch) | |
| tree | a724f0c3dcc48c8ce1f78c2665fe8ef170acb379 /src/webclient.cpp | |
| parent | 5bb3f3f92e62a0af02fe475943759b8c25cd4592 (diff) | |
| download | kristall-33c91102a58e2fbcf9d7a66e33b41a65fa3f0e0c.tar.gz | |
Adds improved client certificate management, adds server certificate management.
Diffstat (limited to 'src/webclient.cpp')
| -rw-r--r-- | src/webclient.cpp | 16 |
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(); +} |
