summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qdtls_openssl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/ssl/qdtls_openssl.cpp')
-rw-r--r--src/network/ssl/qdtls_openssl.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/network/ssl/qdtls_openssl.cpp b/src/network/ssl/qdtls_openssl.cpp
index 9b11f58f2f..1f4b5a0419 100644
--- a/src/network/ssl/qdtls_openssl.cpp
+++ b/src/network/ssl/qdtls_openssl.cpp
@@ -1115,13 +1115,18 @@ bool QDtlsPrivateOpenSSL::resumeHandshake(QUdpSocket *socket)
void QDtlsPrivateOpenSSL::abortHandshake(QUdpSocket *socket)
{
Q_ASSERT(socket);
- Q_ASSERT(handshakeState == QDtls::PeerVerificationFailed);
+ Q_ASSERT(handshakeState == QDtls::PeerVerificationFailed
+ || handshakeState == QDtls::HandshakeInProgress);
clearDtlsError();
- // Yes, while peer verification failed, we were actually encrypted.
- // Let's play it nice - inform our peer about connection shut down.
- sendShutdownAlert(socket);
+ if (handshakeState == QDtls::PeerVerificationFailed) {
+ // Yes, while peer verification failed, we were actually encrypted.
+ // Let's play it nice - inform our peer about connection shut down.
+ sendShutdownAlert(socket);
+ } else {
+ resetDtls();
+ }
}
void QDtlsPrivateOpenSSL::sendShutdownAlert(QUdpSocket *socket)