From 3d24850db5b41eeda1089212b6a3bafd9ce4c5b9 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Tue, 28 Sep 2021 11:29:27 +0330 Subject: [PATCH] LibTLS: Mark the connection as finished and disconnected on TLS error --- Userland/Libraries/LibTLS/Socket.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibTLS/Socket.cpp b/Userland/Libraries/LibTLS/Socket.cpp index 68417d5cf4..82fa714a38 100644 --- a/Userland/Libraries/LibTLS/Socket.cpp +++ b/Userland/Libraries/LibTLS/Socket.cpp @@ -226,6 +226,9 @@ bool TLSv12::check_connection_state(bool read) m_context.has_invoked_finish_or_error_callback = true; if (on_tls_error) on_tls_error((AlertDescription)m_context.critical_error); + m_context.connection_finished = true; + m_context.connection_status = ConnectionStatus::Disconnected; + Core::Socket::close(); return false; } if (((read && m_context.application_buffer.size() == 0) || !read) && m_context.connection_finished) {