SSLErrorDialog: We cannot use the existing key chain

... use the one returned by the new server instead.
This commit is contained in:
Daniel Molkentin 2013-03-22 11:18:16 +01:00
parent a766a44bcf
commit 1831a975eb
3 changed files with 6 additions and 6 deletions

View File

@ -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();

View File

@ -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();

View File

@ -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();