Important: Please read the Qt Code of Conduct -

[SOLVED]SSL verification fails but the request continue !!!!

  • Hi guys,

    I am trying to use an api and i have been asked to be sure first that i am using our backend using ssl verification.

    so I used the following code
    @ QFile certFile("d:/backend.cer");
    qDebug()<< "is ssl supported? " << QSslSocket::supportsSsl();
    QByteArray certContent = certFile.readAll();

    QSslCertificate cert(certContent, QSsl::Der);
    kdebug() <<"Cert info: " << cert.effectiveDate() << cert.expiryDate() << cert.issuerInfo(QSslCertificate::Organization);
    QSslConfiguration sslConfig = request.sslConfiguration();
    sslConfig.setCaCertificates(QList<QSslCertificate>()<< cert);


    I have two problems here
    1- The certificate is not verified and i always get the following response
    "ssl error = "The issuer certificate of a locally looked up certificate could not be found"
    ssl error = "The root CA certificate is not trusted for this purpose""

    2- However the ssl fails to verify the certificate it continues the request and receive the data!!!!

    Could any body please help?


  • Is there any body here?

  • I fixed it. I should not igonre ssl errors

Log in to reply