summaryrefslogtreecommitdiffstats
path: root/logic/auth
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-12-24 23:38:37 +0100
committerPetr Mrázek <peterix@gmail.com>2013-12-24 23:39:04 +0100
commit8d0ca72abb10b0cb77816d44f3f768865cc23aef (patch)
tree07a866c3625bad8369ed55dea89034b288358591 /logic/auth
parent027aafc3c1fc5e78c91ee439cd38562387f7ed9f (diff)
downloadMultiMC-8d0ca72abb10b0cb77816d44f3f768865cc23aef.tar
MultiMC-8d0ca72abb10b0cb77816d44f3f768865cc23aef.tar.gz
MultiMC-8d0ca72abb10b0cb77816d44f3f768865cc23aef.tar.lz
MultiMC-8d0ca72abb10b0cb77816d44f3f768865cc23aef.tar.xz
MultiMC-8d0ca72abb10b0cb77816d44f3f768865cc23aef.zip
Log SSL errors, give common solutions
Diffstat (limited to 'logic/auth')
-rw-r--r--logic/auth/YggdrasilTask.cpp24
-rw-r--r--logic/auth/YggdrasilTask.h2
2 files changed, 26 insertions, 0 deletions
diff --git a/logic/auth/YggdrasilTask.cpp b/logic/auth/YggdrasilTask.cpp
index 573dd57a..3ba53bd7 100644
--- a/logic/auth/YggdrasilTask.cpp
+++ b/logic/auth/YggdrasilTask.cpp
@@ -48,6 +48,7 @@ void YggdrasilTask::executeTask()
connect(m_netReply, &QNetworkReply::finished, this, &YggdrasilTask::processReply);
connect(m_netReply, &QNetworkReply::uploadProgress, this, &YggdrasilTask::refreshTimers);
connect(m_netReply, &QNetworkReply::downloadProgress, this, &YggdrasilTask::refreshTimers);
+ connect(m_netReply, &QNetworkReply::sslErrors, this, &YggdrasilTask::sslErrors);
timeout_keeper.setSingleShot(true);
timeout_keeper.start(timeout_max);
counter.setSingleShot(false);
@@ -75,10 +76,33 @@ void YggdrasilTask::abort()
m_netReply->abort();
}
+void YggdrasilTask::sslErrors(QList<QSslError> errors)
+{
+ int i = 1;
+ for(auto error: errors)
+ {
+ QLOG_ERROR() << "LOGIN SSL Error #" << i << " : " << error.errorString();
+ auto cert = error.certificate();
+ QLOG_ERROR() << "Certificate in question:\n" << cert.toText();
+ i++;
+ }
+}
+
void YggdrasilTask::processReply()
{
setStatus(getStateMessage(STATE_PROCESSING_RESPONSE));
+ if (m_netReply->error() == QNetworkReply::SslHandshakeFailedError)
+ {
+ emitFailed(tr("<b>SSL Handshake failed.</b><br/>There might be a few causes for it:<br/>"
+ "<ul>"
+ "<li>You use Windows XP and need to <a href=\"http://www.microsoft.com/en-us/download/details.aspx?id=38918\">update your root certificates</a></li>"
+ "<li>Some device on your network is interfering with SSL traffic. In that case, you have bigger worries than Minecraft not starting.</li>"
+ "<li>Possibly something else. Check the MultiMC log file for details</li>"
+ "</ul>"));
+ return;
+ }
+
// any network errors lead to offline mode right now
if (m_netReply->error() >= QNetworkReply::ConnectionRefusedError &&
m_netReply->error() <= QNetworkReply::UnknownNetworkError)
diff --git a/logic/auth/YggdrasilTask.h b/logic/auth/YggdrasilTask.h
index 1f81a2d0..85f5a1e1 100644
--- a/logic/auth/YggdrasilTask.h
+++ b/logic/auth/YggdrasilTask.h
@@ -20,6 +20,7 @@
#include <QString>
#include <QJsonObject>
#include <QTimer>
+#include <qsslerror.h>
#include "logic/auth/MojangAccount.h"
@@ -99,6 +100,7 @@ slots:
void processReply();
void refreshTimers(qint64, qint64);
void heartbeat();
+ void sslErrors(QList<QSslError>);
public
slots: