PDA

View Full Version : [Certificate]What is the different of QSslConfiguration and QSslSocket?



horoma
18th October 2012, 03:54
Hi all,
In main.cpp, when I use QSsl Configuration to set the CaCertificate and then I go to "https://mail.google.com/", the log say

Received finished signal while progress is still: 10 Url: QUrl( "https://mail.google.com/" )

And the Qtwebkit hangs. I copy some of code here:

QSslConfiguration config = QSslConfiguration::defaultConfiguration();
QList<QSslCertificate> Certs = QSslCertificate::fromPath("<cert_path>", QSsl::Pem);
config.setCaCertificates(Certs);

But when I use QSslSocket to set the default ca certificate, and load the website again, it works.

QList<QSslCertificate> CaCerts = QSslCertificate::fromPath(<cert_path>, QSsl::Pem);
QSslSocket::setDefaultCaCertificates(CaCerts);

So, I don't know what is the different between QSslConfiguration and QSslSocket to set the ca certificate.
Can anyone help? As I don't need server side, I support I will not create socket.