LibTLS: Close connection on fatal error

The OpenSSL documentation mentions that after `SSL_ERROR_SYSCALL` or
`SSL_ERROR_SSL` no further operations should be performed and
`SSL_shutdown` should not be called.

When a fatal error occurs, close the underlying socket and free the
`SSL` struct.
This commit is contained in:
devgianlu 2025-02-22 12:44:22 +01:00 committed by Ali Mohammad Pur
commit 1563054a63
Notes: github-actions[bot] 2025-02-22 17:41:02 +00:00
2 changed files with 48 additions and 9 deletions

View file

@ -69,6 +69,8 @@ private:
static ErrorOr<NonnullOwnPtr<TLSv12>> connect_internal(NonnullOwnPtr<Core::TCPSocket>, ByteString const&, Options);
void handle_fatal_error();
SSL_CTX* m_ssl_ctx { nullptr };
SSL* m_ssl { nullptr };
BIO* m_bio { nullptr };