NOISSUE catch and log SSL errors for Download(s)

This commit is contained in:
Petr Mrázek 2017-11-01 22:52:11 +01:00
parent e6d734d9ac
commit e44a0cb944
2 changed files with 13 additions and 0 deletions

View File

@ -135,6 +135,18 @@ void Download::downloadError(QNetworkReply::NetworkError error)
} }
} }
void Download::sslErrors(const QList<QSslError> & errors)
{
int i = 1;
for (auto error : errors)
{
qCritical() << "Download" << m_url.toString() << "SSL Error #" << i << " : " << error.errorString();
auto cert = error.certificate();
qCritical() << "Certificate in question:\n" << cert.toText();
i++;
}
}
bool Download::handleRedirect() bool Download::handleRedirect()
{ {
QVariant redirect = m_reply->header(QNetworkRequest::LocationHeader); QVariant redirect = m_reply->header(QNetworkRequest::LocationHeader);

View File

@ -58,6 +58,7 @@ private: /* methods */
protected slots: protected slots:
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal) override; void downloadProgress(qint64 bytesReceived, qint64 bytesTotal) override;
void downloadError(QNetworkReply::NetworkError error) override; void downloadError(QNetworkReply::NetworkError error) override;
void sslErrors(const QList<QSslError> & errors);
void downloadFinished() override; void downloadFinished() override;
void downloadReadyRead() override; void downloadReadyRead() override;