mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
make ssldialog aware of custom configs.
This commit is contained in:
parent
5953d36297
commit
f0bae07a2c
2 changed files with 9 additions and 2 deletions
|
@ -37,7 +37,7 @@ SslErrorDialog::SslErrorDialog(QWidget *parent) :
|
|||
|
||||
QList<QSslCertificate> SslErrorDialog::storedCACerts()
|
||||
{
|
||||
MirallConfigFile cfg;
|
||||
MirallConfigFile cfg( _customConfigHandle );
|
||||
QSettings settings( cfg.configFile(), QSettings::IniFormat);
|
||||
|
||||
QList<QSslCertificate> cacerts = QSslCertificate::fromData(settings.value(QLatin1String("CaCertificates")).toByteArray());
|
||||
|
@ -166,7 +166,8 @@ void SslErrorDialog::accept()
|
|||
{
|
||||
// Save the contents of _unknownCerts to the settings file.
|
||||
if( trustConnection() && _unknownCerts.count() > 0 ) {
|
||||
MirallConfigFile cfg;
|
||||
MirallConfigFile cfg( _customConfigHandle );
|
||||
|
||||
QSettings settings( cfg.configFile(), QSettings::IniFormat);
|
||||
|
||||
QByteArray certs = settings.value(QLatin1String("CaCertificates")).toByteArray();
|
||||
|
@ -190,5 +191,9 @@ void SslErrorDialog::accept()
|
|||
QDialog::accept();
|
||||
}
|
||||
|
||||
void SslErrorDialog::setCustomConfigHandle( const QString& handle )
|
||||
{
|
||||
_customConfigHandle = handle;
|
||||
}
|
||||
|
||||
} // end namespace
|
||||
|
|
|
@ -37,6 +37,7 @@ public:
|
|||
|
||||
bool trustConnection();
|
||||
|
||||
void setCustomConfigHandle( const QString& );
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
@ -50,6 +51,7 @@ private:
|
|||
QString certDiv( QSslCertificate ) const;
|
||||
|
||||
QList<QSslCertificate> _unknownCerts;
|
||||
QString _customConfigHandle;
|
||||
};
|
||||
} // end namespace
|
||||
|
||||
|
|
Loading…
Reference in a new issue