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"); Q_ASSERT(certFile.open(QIODevice::ReadOnly)); QSslCertificate cert(&certFile, QSsl::Pem); QSslSocket *sslSocket = new QSslSocket(this); sslSocket->addCaCertificate(cert);
??
-
@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, cert.at(0));
QList<QSslError> expectedSslErrors;
expectedSslErrors.append(error);QSslSocket socket; socket.ignoreSslErrors(expectedSslErrors); socket.connectToHostEncrypted("https://host",port);
-
@mcosta
W/libPmps.so(10267): (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_client_method
W/libPmps.so(10267): (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_client_method
W/libPmps.so(10267): (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve TLSv1_1_server_method
W/libPmps.so(10267): (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve TLSv1_2_server_method
W/libPmps.so(10267): (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve SSL_select_next_proto
W/libPmps.so(10267): (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb
W/libPmps.so(10267): (null):0 ((null)): qt.network.ssl: QSslSocket: cannot resolve SSL_get0_next_proto_negotiated