AbstractSslErrorHandler: Also give QSslConfiguration

This commit is contained in:
Markus Goetz 2015-04-06 21:46:03 +02:00
parent dafc2d2b73
commit 750cdc1910
6 changed files with 8 additions and 6 deletions

View file

@ -15,9 +15,10 @@
#include "account.h"
#include "simplesslerrorhandler.h"
bool SimpleSslErrorHandler::handleErrors(QList<QSslError> errors, QList<QSslCertificate> *certs, OCC::AccountPtr account)
bool SimpleSslErrorHandler::handleErrors(QList<QSslError> errors, const QSslConfiguration &conf, QList<QSslCertificate> *certs, OCC::AccountPtr account)
{
(void) account;
(void) conf;
if (!certs) {
qDebug() << "Certs parameter required but is NULL!";

View file

@ -20,7 +20,7 @@ class QSslCertificate;
class SimpleSslErrorHandler : public OCC::AbstractSslErrorHandler {
public:
bool handleErrors(QList<QSslError> errors, QList<QSslCertificate> *certs, OCC::AccountPtr) Q_DECL_OVERRIDE;
bool handleErrors(QList<QSslError> errors, const QSslConfiguration &conf, QList<QSslCertificate> *certs, OCC::AccountPtr) Q_DECL_OVERRIDE;
};
#endif // SIMPLESSLERRORHANDLER_H

View file

@ -34,8 +34,9 @@ namespace Utility {
}
#endif
bool SslDialogErrorHandler::handleErrors(QList<QSslError> errors, QList<QSslCertificate> *certs, AccountPtr account)
bool SslDialogErrorHandler::handleErrors(QList<QSslError> errors, const QSslConfiguration &conf, QList<QSslCertificate> *certs, AccountPtr account)
{
(void) conf;
if (!certs) {
qDebug() << "Certs parameter required but is NULL!";
return false;

View file

@ -33,7 +33,7 @@ class SslErrorDialog;
class SslDialogErrorHandler : public AbstractSslErrorHandler {
public:
bool handleErrors(QList<QSslError> errors, QList<QSslCertificate> *certs, AccountPtr) Q_DECL_OVERRIDE;
bool handleErrors(QList<QSslError> errors, const QSslConfiguration &conf, QList<QSslCertificate> *certs, AccountPtr) Q_DECL_OVERRIDE;
};
class SslErrorDialog : public QDialog

View file

@ -475,7 +475,7 @@ void Account::slotHandleErrors(QNetworkReply *reply , QList<QSslError> 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.

View file

@ -62,7 +62,7 @@ private:
class AbstractSslErrorHandler {
public:
virtual ~AbstractSslErrorHandler() {}
virtual bool handleErrors(QList<QSslError>, QList<QSslCertificate>*, AccountPtr) = 0;
virtual bool handleErrors(QList<QSslError>, const QSslConfiguration &conf, QList<QSslCertificate>*, AccountPtr) = 0;
};
/**