diff options
Diffstat (limited to 'src/murmur/Cert.cpp')
-rw-r--r-- | src/murmur/Cert.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/murmur/Cert.cpp b/src/murmur/Cert.cpp index 49f8c8626..cf08ebfb1 100644 --- a/src/murmur/Cert.cpp +++ b/src/murmur/Cert.cpp @@ -116,13 +116,23 @@ void Server::initializeCert() { qlCA = ql; } - if (qscCert.issuerInfo(QSslCertificate::CommonName) == QLatin1String("Murmur Autogenerated Certificate")) { + QString issuer; +#if QT_VERSION >= 0x050000 + QStringList issuerNames = qscCert.issuerInfo(QSslCertificate::CommonName); + if (! issuerNames.isEmpty()) { + issuer = issuerNames.first(); + } +#else + issuer = qscCert.issuerInfo(QSslCertificate::CommonName); +#endif + + if (issuer == QString::fromUtf8("Murmur Autogenerated Certificate")) { log("Old autogenerated certificate is unusable for registration, invalidating it"); qscCert = QSslCertificate(); qskKey = QSslKey(); } - if (!qscCert.isNull() && (qscCert.issuerInfo(QSslCertificate::CommonName) == QLatin1String("Murmur Autogenerated Certificate v2")) && ! Meta::mp.qscCert.isNull() && ! Meta::mp.qskKey.isNull() && (Meta::mp.qlBind == qlBind)) { + if (!qscCert.isNull() && issuer == QString::fromUtf8("Murmur Autogenerated Certificate v2") && ! Meta::mp.qscCert.isNull() && ! Meta::mp.qskKey.isNull() && (Meta::mp.qlBind == qlBind)) { qscCert = Meta::mp.qscCert; qskKey = Meta::mp.qskKey; } |