From 86058e710790e453d139d5cb03e38c7f62de1dbf Mon Sep 17 00:00:00 2001 From: Max Wittal Date: Sun, 5 Apr 2020 21:19:58 +0200 Subject: [PATCH] SSL_shutdown() only if not already closed by remote --- httplib.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/httplib.h b/httplib.h index dffc58a3a6..ed48c9a21f 100644 --- a/httplib.h +++ b/httplib.h @@ -4397,7 +4397,9 @@ inline bool process_and_close_socket_ssl( } } - SSL_shutdown(ssl); + if (ret) { + SSL_shutdown(ssl); // shutdown only if not already closed by remote + } { std::lock_guard guard(ctx_mutex); SSL_free(ssl);