Important: Please read the Qt Code of Conduct -

self signed Certificate error

  • How to install or load a crt or pfx Certificate in Qt for webService https untrusted , using soap library request

    i use this code deploying in android , but still appear
    error: Network transport error (6): SSL handshake failed"

    QFile certFile(":/cert.crt");
    QSslCertificate cert(&certFile, QSsl::Pem);
    QSslSocket *sslSocket = new QSslSocket(this);


  • Hi and welcome to devnet,

    here you can see how to disable this error (by default Qt don't allows self-signed certificate)

  • @mcosta thanks for reply
    i use that one but im still have the same problem
    QList<QSslCertificate> cert = QSslCertificate::fromPath(QLatin1String(":/certificate.crt"));
    QSslError error(QSslError::SelfSignedCertificate,;
    QList<QSslError> expectedSslErrors;

     QSslSocket socket;

  • Hi,

    can you print the list of SSL errors? qDebug() << socket.sslErrors()

  • @mcosta
    W/ (null):0 ((null)): QSslSocket: cannot resolve TLSv1_1_client_method
    W/ (null):0 ((null)): QSslSocket: cannot resolve TLSv1_2_client_method
    W/ (null):0 ((null)): QSslSocket: cannot resolve TLSv1_1_server_method
    W/ (null):0 ((null)): QSslSocket: cannot resolve TLSv1_2_server_method
    W/ (null):0 ((null)): QSslSocket: cannot resolve SSL_select_next_proto
    W/ (null):0 ((null)): QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb
    W/ (null):0 ((null)): QSslSocket: cannot resolve SSL_get0_next_proto_negotiated