mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
SSLErrorDialog: We cannot use the existing key chain
... use the one returned by the new server instead.
This commit is contained in:
parent
a766a44bcf
commit
1831a975eb
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user