QSslSocket: Set isEncrypted to false on disconnect
Since we're no longer connected, much less encrypted. Was done in schannel backend, but not in ST or OpenSSL Pick-to: 6.2 Change-Id: Ia49387be0088f899a0c89091f7e468dba1c0eee6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
parent
1587d75b5e
commit
664a6621fb
@ -1127,6 +1127,7 @@ void TlsCryptographOpenSSL::disconnected()
|
||||
Q_ASSERT(d);
|
||||
auto *plainSocket = d->plainTcpSocket();
|
||||
Q_ASSERT(plainSocket);
|
||||
d->setEncrypted(false);
|
||||
|
||||
if (plainSocket->bytesAvailable() <= 0) {
|
||||
destroySslContext();
|
||||
|
@ -398,6 +398,7 @@ void TlsCryptographSecureTransport::continueHandshake()
|
||||
void TlsCryptographSecureTransport::disconnected()
|
||||
{
|
||||
Q_ASSERT(d && d->plainTcpSocket());
|
||||
d->setEncrypted(false);
|
||||
if (d->plainTcpSocket()->bytesAvailable() <= 0)
|
||||
destroySslContext();
|
||||
// If there is still buffered data in the plain socket, don't destroy the ssl context yet.
|
||||
|
@ -1092,6 +1092,7 @@ void tst_QSslSocket::connectToHostEncrypted()
|
||||
|
||||
socket->disconnectFromHost();
|
||||
QVERIFY(socket->waitForDisconnected());
|
||||
QVERIFY(!socket->isEncrypted());
|
||||
|
||||
QCOMPARE(socket->mode(), QSslSocket::SslClientMode);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user