PDA

View Full Version : TLS1.1 is not working in QT.4.7.4



subhashree satpathy
4th April 2018, 05:49
We updated TLS 1.0 to TLS 1.1 . But our application ( QT 4.7.4 ) does not support TLS 1.1 .Currently we are using QNetworkManager to communicate with server and https is not atall hitting the server.so please suggest us how we can resolve this issue ?In Qt 5.x same code working perfectly and getting the data also.here is a sample code


void Downloader::doDownload()

{
manager = new QNetworkAccessManager(this);
connect(manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(replyFinished(QNetworkReply*)));
manager->get(QNetworkRequest(QUrl("https://www.yahoo.com")));

}
void Downloader::replyFinished (QNetworkReply *reply)
{
if(reply->error())
{
qDebug() << "ERROR!";
qDebug() << reply->errorString();
}
else
{
qDebug() << reply->header(QNetworkRequest::ContentTypeHeader).toStrin g();
qDebug() << reply->header(QNetworkRequest::LastModifiedHeader).toDate Time().toString();
qDebug() << reply->header(QNetworkRequest::ContentLengthHeader).toULo ngLong();
qDebug() << reply->attribute(QNetworkRequest::HttpStatusCodeAttribute ).toInt();
qDebug() << reply->attribute(QNetworkRequest::HttpReasonPhraseAttribu te).toString();

QFile *file = new QFile("/root/NETWORK/tlsnet/ntwrkmangr/downloaded.txt");
if(file->open(QFile::Append))
{
file->write(reply->readAll());
file->flush();
file->close();
}
delete file;
}

reply->deleteLater();
}

PNaveen
6th July 2018, 13:40
Yes, Qt 5.x supports TLS 1.1 and above.
Apparently, your qt 4.7.4 app doesn't work until you build your app with higher versions of Qt, i mean(upgradation needed). i'm also in same situation if u solved kindly let me know what u have done
Thank you