From 63e5f90632be03c2f71e3ba8290e74147e46e592 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 22 May 2019 13:58:27 +0200 Subject: [PATCH] Ignore self signed ssl certs for connections to localhost --- libnymea-app-core/connection/nymeaconnection.cpp | 6 +++++- nymea-app/ui/MainPage.qml | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libnymea-app-core/connection/nymeaconnection.cpp b/libnymea-app-core/connection/nymeaconnection.cpp index ba051543..85191214 100644 --- a/libnymea-app-core/connection/nymeaconnection.cpp +++ b/libnymea-app-core/connection/nymeaconnection.cpp @@ -177,8 +177,12 @@ void NymeaConnection::onSslErrors(const QList &errors) certificateFingerprint.append(digest.mid(i,1).toHex().toUpper()); } + // Ignore self signed certs for connections to localhost + if (QHostAddress(transport->url().host()) == QHostAddress::LocalHost || QHostAddress(transport->url().host()) == QHostAddress::LocalHostIPv6) { + ignoredErrors.append(error); + // Check old style fingerprint storage - if (storedFingerPrint == certificateFingerprint) { + } else if (storedFingerPrint == certificateFingerprint) { qDebug() << "This fingerprint is known to us."; ignoredErrors.append(error); diff --git a/nymea-app/ui/MainPage.qml b/nymea-app/ui/MainPage.qml index ac1276d6..ee387cb1 100644 --- a/nymea-app/ui/MainPage.qml +++ b/nymea-app/ui/MainPage.qml @@ -168,7 +168,6 @@ Page { ColorIcon { height: app.iconSize / 2 width: height - visible: infoPane.connectedState !== null && infoPane.connectedState.value === false color: "white" name: "../images/system-update.svg" RotationAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; running: engine.systemController.updateRunning }