From 750cdc1910a5a74d85a7fb3be27e3ad1c2acc70c Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Mon, 6 Apr 2015 21:46:03 +0200 Subject: [PATCH] AbstractSslErrorHandler: Also give QSslConfiguration --- src/cmd/simplesslerrorhandler.cpp | 3 ++- src/cmd/simplesslerrorhandler.h | 2 +- src/gui/sslerrordialog.cpp | 3 ++- src/gui/sslerrordialog.h | 2 +- src/libsync/account.cpp | 2 +- src/libsync/account.h | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/cmd/simplesslerrorhandler.cpp b/src/cmd/simplesslerrorhandler.cpp index c5a98c1f0..60a68c4d5 100644 --- a/src/cmd/simplesslerrorhandler.cpp +++ b/src/cmd/simplesslerrorhandler.cpp @@ -15,9 +15,10 @@ #include "account.h" #include "simplesslerrorhandler.h" -bool SimpleSslErrorHandler::handleErrors(QList errors, QList *certs, OCC::AccountPtr account) +bool SimpleSslErrorHandler::handleErrors(QList errors, const QSslConfiguration &conf, QList *certs, OCC::AccountPtr account) { (void) account; + (void) conf; if (!certs) { qDebug() << "Certs parameter required but is NULL!"; diff --git a/src/cmd/simplesslerrorhandler.h b/src/cmd/simplesslerrorhandler.h index 956c637d0..11b99a19f 100644 --- a/src/cmd/simplesslerrorhandler.h +++ b/src/cmd/simplesslerrorhandler.h @@ -20,7 +20,7 @@ class QSslCertificate; class SimpleSslErrorHandler : public OCC::AbstractSslErrorHandler { public: - bool handleErrors(QList errors, QList *certs, OCC::AccountPtr) Q_DECL_OVERRIDE; + bool handleErrors(QList errors, const QSslConfiguration &conf, QList *certs, OCC::AccountPtr) Q_DECL_OVERRIDE; }; #endif // SIMPLESSLERRORHANDLER_H diff --git a/src/gui/sslerrordialog.cpp b/src/gui/sslerrordialog.cpp index b6c6e2a24..ec8acd952 100644 --- a/src/gui/sslerrordialog.cpp +++ b/src/gui/sslerrordialog.cpp @@ -34,8 +34,9 @@ namespace Utility { } #endif -bool SslDialogErrorHandler::handleErrors(QList errors, QList *certs, AccountPtr account) +bool SslDialogErrorHandler::handleErrors(QList errors, const QSslConfiguration &conf, QList *certs, AccountPtr account) { + (void) conf; if (!certs) { qDebug() << "Certs parameter required but is NULL!"; return false; diff --git a/src/gui/sslerrordialog.h b/src/gui/sslerrordialog.h index 885a1e7b8..68f0fee7e 100644 --- a/src/gui/sslerrordialog.h +++ b/src/gui/sslerrordialog.h @@ -33,7 +33,7 @@ class SslErrorDialog; class SslDialogErrorHandler : public AbstractSslErrorHandler { public: - bool handleErrors(QList errors, QList *certs, AccountPtr) Q_DECL_OVERRIDE; + bool handleErrors(QList errors, const QSslConfiguration &conf, QList *certs, AccountPtr) Q_DECL_OVERRIDE; }; class SslErrorDialog : public QDialog diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp index 990b482d2..465ba0c60 100644 --- a/src/libsync/account.cpp +++ b/src/libsync/account.cpp @@ -475,7 +475,7 @@ void Account::slotHandleErrors(QNetworkReply *reply , QList errors) return; } - if (_sslErrorHandler->handleErrors(errors, &approvedCerts, sharedFromThis())) { + if (_sslErrorHandler->handleErrors(errors, reply->sslConfiguration(), &approvedCerts, sharedFromThis())) { QSslSocket::addDefaultCaCertificates(approvedCerts); addApprovedCerts(approvedCerts); // all ssl certs are known and accepted. We can ignore the problems right away. diff --git a/src/libsync/account.h b/src/libsync/account.h index 3d8604f2b..19af18fa9 100644 --- a/src/libsync/account.h +++ b/src/libsync/account.h @@ -62,7 +62,7 @@ private: class AbstractSslErrorHandler { public: virtual ~AbstractSslErrorHandler() {} - virtual bool handleErrors(QList, QList*, AccountPtr) = 0; + virtual bool handleErrors(QList, const QSslConfiguration &conf, QList*, AccountPtr) = 0; }; /** -- 2.30.2