syncthingtray/connector/syncthingconnectionsettings...

22 lines
758 B
C++
Raw Normal View History

#include "./syncthingconnectionsettings.h"
namespace Data {
bool SyncthingConnectionSettings::loadHttpsCert()
{
2016-10-02 21:59:28 +02:00
expectedSslErrors.clear();
2017-05-01 03:34:43 +02:00
if (!httpsCertPath.isEmpty()) {
const QList<QSslCertificate> cert = QSslCertificate::fromPath(httpsCertPath);
2017-05-01 03:34:43 +02:00
if (cert.isEmpty()) {
return false;
}
expectedSslErrors.reserve(4);
expectedSslErrors << QSslError(QSslError::UnableToGetLocalIssuerCertificate, cert.at(0));
expectedSslErrors << QSslError(QSslError::UnableToVerifyFirstCertificate, cert.at(0));
expectedSslErrors << QSslError(QSslError::SelfSignedCertificate, cert.at(0));
expectedSslErrors << QSslError(QSslError::HostNameMismatch, cert.at(0));
}
return true;
}
}