Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
4.7.4, 4.8.0
-
None
-
Linux and Windows
Description
Hello
We are developing a commercial application based on Qt-4.7.4 and we have found an issue with the networking. Our application is using QNetworkAccessManager::post() to send a SOAP request to a backend HTTPS server. We are testing our program with intensive requests made to the HTTPS server which is fronted by an SSL proxy hosted on an F5 BIG-IP Local Traffic Manager (LTM).
The problem we are having is a minority of the HTTPS requests fail. There are HTTPS specific issues happening during the handhake and network captures show that the Qt application closes the TCP connection just after the "Server Hello, Certificate, Server Hello Done" packet has been sent by the server.
The application is running two threads: the first thread is a listener that uses QTcpServer to receive connections from a client, and the second thread contains most of the code and connects to the HTTP server using QNetworkAccessManager::post().
We have compiled Qt with the debugging turned on to see what happens and it sounds the connection is being closed by QNativeSocketEngine::read() when "readBytes == 0". The problem is none of the following QNetworkReply signals are being sent: SIGNAL(sslErrors(const QList<QSslError> &)), SIGNAL(error(QNetworkReply::NetworkError)), SIGNAL(readyRead()), SIGNAL(finished()), SIGNAL(aboutToClose()). So the timer (implemented using QTimer in the application) expires after 5 seconds.
Our application has been developed for both Linux x86_64 and Windows using the mingw32, and we can see this problem on both platforms. We have found a workaround which allows the application to send thousands of requests without any problem: We have added two lines in QSslSocket::close() to destroy the plainSocket object. This forces Qt to recreate a new QTcpSocket object from scratch the next time it connects to the server.
Thanks