TLS connection using self signed certificates
Posted: Fri Dec 10 2021 3:25 pm
Hi,
I am using Coperspice 1.7.2 On Windows 10. I am trying to create a TLS connection to a Service on another Device, which has provided a self signed certificate for the connection.
I had this working in QT 4.8 with t he following code: -
QList<QSslCertificate> trustedCas = QSslCertificate::fromPath(certificate);
socket->setCaCertificates(trustedCas);
However the setCaCertificates method is not implemented for the QSslSocket class in Copperspice 1.7.2.
I have tried the following : -
QList<QSslCertificate> trustedCas = QSslCertificate::fromPath(certificate);
sslConfiguration.setCaCertificates(trustedCas);
socket->setSslConfiguration(sslConfiguration);
and
QList<QSslCertificate> trustedCas = QSslCertificate::fromPath(certificate);
socket->addCaCertificates(trustedCas);
but I keep on getting a SSL/TLS handshake error.
Does anyone know how to do this using Copperspice?
Kind Regards,
John
I am using Coperspice 1.7.2 On Windows 10. I am trying to create a TLS connection to a Service on another Device, which has provided a self signed certificate for the connection.
I had this working in QT 4.8 with t he following code: -
QList<QSslCertificate> trustedCas = QSslCertificate::fromPath(certificate);
socket->setCaCertificates(trustedCas);
However the setCaCertificates method is not implemented for the QSslSocket class in Copperspice 1.7.2.
I have tried the following : -
QList<QSslCertificate> trustedCas = QSslCertificate::fromPath(certificate);
sslConfiguration.setCaCertificates(trustedCas);
socket->setSslConfiguration(sslConfiguration);
and
QList<QSslCertificate> trustedCas = QSslCertificate::fromPath(certificate);
socket->addCaCertificates(trustedCas);
but I keep on getting a SSL/TLS handshake error.
Does anyone know how to do this using Copperspice?
Kind Regards,
John