2016-09-29 21:19:54 +02:00
|
|
|
#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()) {
|
2016-09-29 21:19:54 +02:00
|
|
|
const QList<QSslCertificate> cert = QSslCertificate::fromPath(httpsCertPath);
|
2017-05-01 03:34:43 +02:00
|
|
|
if (cert.isEmpty()) {
|
2016-09-29 21:19:54 +02:00
|
|
|
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;
|
|
|
|
}
|
2017-09-17 21:48:15 +02:00
|
|
|
} // namespace Data
|