Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.9.0
-
Windows 7
-
ef4ba0285f9c5dd5ee2dca1e0cefee45eba3477c (qt/qtbase/dev)
Description
When using QSslSocket::close() behind a proxy then a device error can occur as it seems to be closing the plain socket prematurely as there seems to be more bytes to be written. If disconnectFromHost() is used instead first then it works fine. An unencrypted connection also works fine.
With the example attached, the following can occur:
on_pushButton_clicked, trying to connect connected encryptedBytesWrittenSlot sent bytes= 517 false encryptedBytesWrittenSlot sent bytes= 126 false encryptedSlot size sent=104857600 bytesWrittenSlot sent bytes= 104857600 true encryptedBytesWrittenSlot sent bytes= 105043200 true QIODevice::write (QTcpSocket): device not open errorSlot err=-1
To reproduce, in mainwindow.cpp change the IP address to be the one used by the proxy, and then build the application. Click on the pushbutton to see the result.
Attachments
For Gerrit Dashboard: QTBUG-61307 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
241298,3 | SSL: Don't write to closed socket or write to deallocated buffer | 5.11 | qt/qtbase | Status: MERGED | +2 | 0 |