Could download a file via HTTPS by browser, but not by a Qt-app.
-
There is a URL containing JPEG file.
Browsers download and show it, but a Qt-app doesn't.
Initially it worked several times, but then:
QNetworkReply::NetworkError 99 (QNetworkReply::UnknownNetworkError), reply->errorString () (one of):
- "Connection timed out",
- "Unable to write",
- "Connection closed"
Sometimes it seems to download, but fails converting into JPEG:
QPixmap::loadFromData() == false
Source code:
QNetworkAccessManager *nam = getQNetworkAccessManager (); QNetworkRequest nrq = QNetworkRequest (QUrl (url)); nrq.setHeader (QNetworkRequest::UserAgentHeader, // did not help "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.43 (KHTML, " "like Gecko) Chrome/95.0.4638.69 Safari/537.36 OPR/81.0.4196.54"); QNetworkReply *reply = nam->get (nrq); connect (reply, &QIODevice::readyRead, rcv, od); connect (reply, &QNetworkReply::errorOccurred, rcv, oe); connect (reply, &QNetworkReply::sslErrors, rcv, ose); qDebug() << QSslSocket::sslLibraryBuildVersionString();: "OpenSSL 1.1.1g 21 Apr 2020" qDebug() << QSslSocket::supportsSsl();: true qDebug() << QSslSocket::sslLibraryVersionString();: "OpenSSL 1.1.1g 21 Apr 2020"There are no SSL-errors, onlyQNetworkReply::errorOccurred().
I also asked my firewall to allow the connection.
Will you please help me?
-
Hi and welcome to devnet,
Did you check what is happening with a tool like WireShark ?