How to verify a Digital Certificate using QSSLCertificate?
Unsolved
General and Desktop
-
Below is the code I am using to verify a dummy certificate
QString certFileName = "cert.pem"; QFile certFile(certFileName); QSslCertificate sslClientCert; if (certFile.exists()) { certFile.open(QIODevice::ReadOnly); QSslCertificate cert(&certFile, QSsl::Pem); sslClientCert = cert; } sslConfig = QSslConfiguration::defaultConfiguration(); QList<QSslCertificate>certificates = sslConfig.caCertificates(); certificates.push_front(sslClientCert); sslConfig.setCaCertificates(certificates); QSslConfiguration::setDefaultConfiguration(sslConfig); QList<QSslError>error = sslClientCert.verify(certificates,QString("TestCert")); qDebug()<<error;
I am adding same certificate to the certificate chain.
The SSL error list returned by the function verify is empty. Does that mean that my certificate is successfully verified?