diff options
author | Daniel Molkentin <danimo@owncloud.com> | 2013-03-22 14:18:16 +0400 |
---|---|---|
committer | Daniel Molkentin <danimo@owncloud.com> | 2013-03-22 17:59:22 +0400 |
commit | 1831a975eb276bf88fc2b57013a0f6f2c8ce772e (patch) | |
tree | 0efc64d1958458809024d7d67581ac7ed90fdb79 | |
parent | a766a44bcf8bc35df167f62a678fcff11855949d (diff) |
SSLErrorDialog: We cannot use the existing key chain
... use the one returned by the new server instead.
-rw-r--r-- | src/mirall/application.cpp | 3 | ||||
-rw-r--r-- | src/mirall/sslerrordialog.cpp | 6 | ||||
-rw-r--r-- | src/mirall/sslerrordialog.h | 3 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/mirall/application.cpp b/src/mirall/application.cpp index c4dcde9c7..78294559b 100644 --- a/src/mirall/application.cpp +++ b/src/mirall/application.cpp @@ -392,7 +392,8 @@ void Application::slotSSLFailed( QNetworkReply *reply, QList<QSslError> errors ) } _sslErrorDialog->setCustomConfigHandle( configHandle ); - if( _sslErrorDialog->setErrorList( errors ) ) { + QList<QSslCertificate> certs = reply->sslConfiguration().peerCertificateChain(); + if( _sslErrorDialog->setErrorList( errors, certs) ) { // all ssl certs are known and accepted. We can ignore the problems right away. qDebug() << "Certs are already known and trusted, Warnings are not valid."; reply->ignoreSslErrors(); diff --git a/src/mirall/sslerrordialog.cpp b/src/mirall/sslerrordialog.cpp index ec6fb3a21..e2255a26b 100644 --- a/src/mirall/sslerrordialog.cpp +++ b/src/mirall/sslerrordialog.cpp @@ -57,17 +57,15 @@ QString SslErrorDialog::styleSheet() const } #define QL(x) QLatin1String(x) -bool SslErrorDialog::setErrorList( QList<QSslError> errors ) +bool SslErrorDialog::setErrorList( QList<QSslError> errors, QList<QSslCertificate> certs ) { - QList<QSslCertificate> ourCerts = ownCloudInfo::instance()->certificateChain(); - // check if unknown certs caused errors. _unknownCerts.clear(); QStringList errorStrings; for (int i = 0; i < errors.count(); ++i) { - if (ourCerts.contains(errors.at(i).certificate()) || + if (certs.contains(errors.at(i).certificate()) || _unknownCerts.contains(errors.at(i).certificate() )) continue; errorStrings += errors.at(i).errorString(); diff --git a/src/mirall/sslerrordialog.h b/src/mirall/sslerrordialog.h index 28463c010..2d7e10550 100644 --- a/src/mirall/sslerrordialog.h +++ b/src/mirall/sslerrordialog.h @@ -22,6 +22,7 @@ #include "ui_sslerrordialog.h" class QSslError; +class QSslCertificate; namespace Mirall @@ -33,7 +34,7 @@ class SslErrorDialog : public QDialog, public Ui::sslErrorDialog public: explicit SslErrorDialog(QWidget *parent = 0); - bool setErrorList( QList<QSslError> errors ); + bool setErrorList( QList<QSslError> errors, QList<QSslCertificate> certs ); bool trustConnection(); |