From 106a35d24261b9ddd3a5b36f3a161100fc57f5f8 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Mon, 10 Feb 2020 13:08:57 +0100 Subject: [PATCH] [SSL] Print warning only if something changed --- src/libsync/account.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp index ee6d76305..bdb0cf342 100644 --- a/src/libsync/account.cpp +++ b/src/libsync/account.cpp @@ -418,11 +418,14 @@ void Account::slotHandleSslErrors(QNetworkReply *reply, QList errors) if (!guard) return; - QSslSocket::addDefaultCaCertificates(approvedCerts); - addApprovedCerts(approvedCerts); - emit wantsAccountSaved(this); - // all ssl certs are known and accepted. We can ignore the problems right away. - qCInfo(lcAccount) << out << "Certs are known and trusted! This is not an actual error."; + if (!approvedCerts.isEmpty()) { + QSslSocket::addDefaultCaCertificates(approvedCerts); + addApprovedCerts(approvedCerts); + emit wantsAccountSaved(this); + + // all ssl certs are known and accepted. We can ignore the problems right away. + qCInfo(lcAccount) << out << "Certs are known and trusted! This is not an actual error."; + } // Warning: Do *not* use ignoreSslErrors() (without args) here: // it permanently ignores all SSL errors for this host, even