aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-23 09:55:11 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-23 12:11:20 -0700
commit48e47c904842c83e7693680c7cd38775072d42bb (patch)
treee1400e10de977f5df50dbd0af2afbc9d19a45449 /qt-ui
parent03b2674a13fefb1767e94a76f079e9361e5cf775 (diff)
downloadsubsurface-48e47c904842c83e7693680c7cd38775072d42bb.tar.gz
Windows XP doesn't contain a valid CA for our cloud certificate
This is the authentication check and cloud server availability check which are different from the one git does. The mechanism for overriding things is different from there, but this should work just as well. We intercept the SslErrors signal and if we get the known good hash for our certificate, we simply call it good. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/subsurfacewebservices.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index e2e3b3e78..c34ddd7bf 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -1069,8 +1069,22 @@ void CloudStorageAuthenticate::uploadError(QNetworkReply::NetworkError error)
void CloudStorageAuthenticate::sslErrors(QList<QSslError> errorList)
{
- qDebug() << "Received error response trying to set up https connection with cloud storage backend:";
- Q_FOREACH (QSslError err, errorList) {
- qDebug() << err.errorString();
+ if (verbose) {
+ qDebug() << "Received error response trying to set up https connection with cloud storage backend:";
+ Q_FOREACH (QSslError err, errorList) {
+ qDebug() << err.errorString();
+ }
+ }
+ QSslConfiguration conf = reply->sslConfiguration();
+ QSslCertificate cert = conf.peerCertificate();
+ QByteArray hexDigest = cert.digest().toHex();
+ if (reply->url().toString().contains(prefs.cloud_base_url) &&
+ hexDigest == "13ff44c62996cfa5cd69d6810675490e") {
+ if (verbose)
+ qDebug() << "Overriding SSL check as I recognize the certificate digest" << hexDigest;
+ reply->ignoreSslErrors();
+ } else {
+ if (verbose)
+ qDebug() << "got invalid SSL certificate with hex digest" << hexDigest;
}
}