mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Ported servatrice
This commit is contained in:
parent
80f68306b5
commit
2953c6ba2a
2 changed files with 38 additions and 4 deletions
|
|
@ -234,8 +234,16 @@ bool Servatrice::initServer()
|
|||
if (!certFile.open(QIODevice::ReadOnly))
|
||||
throw QString("Error opening certificate file: %1").arg(certFileName);
|
||||
QSslCertificate cert(&certFile);
|
||||
#if QT_VERSION < 0x050000
|
||||
if (!cert.isValid())
|
||||
throw(QString("Invalid certificate."));
|
||||
#else
|
||||
const QDateTime currentTime = QDateTime::currentDateTime();
|
||||
if(currentTime < cert.effectiveDate() ||
|
||||
currentTime > cert.expiryDate() ||
|
||||
cert.isBlacklisted())
|
||||
throw(QString("Invalid certificate."));
|
||||
#endif
|
||||
qDebug() << "Loading private key...";
|
||||
QFile keyFile(keyFileName);
|
||||
if (!keyFile.open(QIODevice::ReadOnly))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue