cpp
void MainWindow::testHttps()
{
QNetworkAccessManager* pManager = new QNetworkAccessManager(this);
QNetworkRequest request;
QSslConfiguration conf = request.sslConfiguration();
conf.setPeerVerifyMode(QSslSocket::VerifyNone);
conf.setProtocol(QSsl::TlsV1SslV3);
request.setSslConfiguration(conf);
request.setUrl(QUrl("https://www.baidu.com"));
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
QByteArray requetstData;
QNetworkReply* reply = pManager->post(request, requetstData);
connect(reply, &QNetworkReply::finished, this, [=] {
qDebug() << "####################### get data finished...";
QByteArray data = reply->readAll();
qDebug() << data;
});
}
在windows是正常的,可以拿到数据。。
但是在linux上,返回的数据为空,,,,
linux:麒麟V10,arm系统
解决方案:按照以下图片炮制即可。
此时,就可以正常获取数据了。。