mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 15:06:08 +03:00
AbstractSslErrorHandler: Also give QSslConfiguration
This commit is contained in:
parent
dafc2d2b73
commit
750cdc1910
6 changed files with 8 additions and 6 deletions
|
@ -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!";
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue