Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9.3, 5.12.3
-
None
Description
Using QSslSocket it is possible initially to chose wheter to connect to a host using SSL or not.
But if you start with an encrypted connection, you cannot, after closing the connection, connect to another (or the same) host with an unencrypted connection: sslMode() remains set to SslClientMode even after closing/aborting the connection.
QSslSocket socket; socket.connectToHostEncrypted(...); socket.abort(); socket.connectToHost(...); // does not work; socket.sslMode still is SslCLientMode // closing again, and calling connectToHost() yet again: now sslMode()==UnencryptedMode because calling connectToHost resets d->initialized to false, and that causes d->init() to be called which resets sslMode...
Suggestion: in close() oder abort() reset sslMode() to UnencryptedMode so we can use QSslSocket to create unecrypted connections after having used it for an encrypted one before.)
It would be useful if abort() (or some new method) would reset the state of QSslSocket to that of a default constructed one.