[SSL] Print warning only if something changed
authorHannah von Reth <hannah.vonreth@owncloud.com>
Mon, 10 Feb 2020 12:08:57 +0000 (13:08 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:59:06 +0000 (10:59 +0100)
src/libsync/account.cpp

index ee6d76305f562bb63458d1a73cd3f44b05a89392..bdb0cf342ffa27251bcb39c88e3d79659779b036 100644 (file)
@@ -418,11 +418,14 @@ void Account::slotHandleSslErrors(QNetworkReply *reply, QList<QSslError> 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