Qt/C++ QSslCertificate returns null in only one device

Viewed 35

I have a successfully running Qt application. It works in two of my desktop machines and was working correctly in my laptop also. After I re-installed Windows 10 on my laptop, however, a QSslCertificate object returns null only when running on that laptop! This is strange because it happens only in this laptop and seems to work correctly in all other devices. It was even working correctly in the laptop previously.

Here is the code:

QByteArray peer_cert = "-----BEGIN CERTIFICATE-----\r\n"
        "np98bn3b8nq38bnn3bb5n0bn==\r\n" //I have not typed the actual certificate here as it is confidential but I assure you it is 100% legit
        "-----END CERTIFICATE-----";

QSslCertificate peerCert;
peerCert = QSslCertificate(peer_cert, QSsl::Pem);

After the above code, when I do this:

if(peerCert.isNull()){
    qDebug()<<"Error: SSL certificate is NULL!";
}

I get "Error: SSL certificate is NULL!" in qDebug output.

0 Answers
Related