summaryrefslogtreecommitdiffstats
path: root/api/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-11-01 22:52:11 +0100
committerPetr Mrázek <peterix@gmail.com>2017-11-01 22:52:11 +0100
commite44a0cb9445f79e221efcdb4fbef19353a8801f1 (patch)
tree17b9422b1b6fcd0c042ce71f99075f9843d23d7c /api/logic
parente6d734d9ac099d918a9ca70e1579de51f5eca20e (diff)
downloadMultiMC-e44a0cb9445f79e221efcdb4fbef19353a8801f1.tar
MultiMC-e44a0cb9445f79e221efcdb4fbef19353a8801f1.tar.gz
MultiMC-e44a0cb9445f79e221efcdb4fbef19353a8801f1.tar.lz
MultiMC-e44a0cb9445f79e221efcdb4fbef19353a8801f1.tar.xz
MultiMC-e44a0cb9445f79e221efcdb4fbef19353a8801f1.zip
NOISSUE catch and log SSL errors for Download(s)
Diffstat (limited to 'api/logic')
-rw-r--r--api/logic/net/Download.cpp12
-rw-r--r--api/logic/net/Download.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/api/logic/net/Download.cpp b/api/logic/net/Download.cpp
index 12c1b201..aca0c7d7 100644
--- a/api/logic/net/Download.cpp
+++ b/api/logic/net/Download.cpp
@@ -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()
{
QVariant redirect = m_reply->header(QNetworkRequest::LocationHeader);
diff --git a/api/logic/net/Download.h b/api/logic/net/Download.h
index 3347dc96..6554a8dc 100644
--- a/api/logic/net/Download.h
+++ b/api/logic/net/Download.h
@@ -58,6 +58,7 @@ private: /* methods */
protected slots:
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal) override;
void downloadError(QNetworkReply::NetworkError error) override;
+ void sslErrors(const QList<QSslError> & errors);
void downloadFinished() override;
void downloadReadyRead() override;