Hi,
I would like to upgrade my network request to SSL but was not able to find an example on the web how to do this properly. Here is the code I currently have:
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
manager->get(QNetworkRequest(url)); // url = http://xyz...
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
manager->get(QNetworkRequest(url)); // url = http://xyz...
To copy to clipboard, switch view to plain text mode
I changed it to this:
QSslConfiguration sslConfiguration(QSslConfiguration::defaultConfiguration());
sslConfiguration.setProtocol(QSsl::TlsV1_2);
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
manager->get(QNetworkRequest(url)); // url = https://xyz...
QSslConfiguration sslConfiguration(QSslConfiguration::defaultConfiguration());
sslConfiguration.setProtocol(QSsl::TlsV1_2);
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
manager->get(QNetworkRequest(url)); // url = https://xyz...
To copy to clipboard, switch view to plain text mode
The second part is still working, which is really surprising since I use a self-signed ssl certificate. So I am guessing I am doing something wrong here. Can someone help?
Thanks!
Bookmarks