From 1ccddd1b0b33d782df3b2bce01ade0672ff7ae89 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 6 Apr 2020 16:30:21 +0200 Subject: [PATCH] SSL_shutdown() only if not already closed by remote (#413) --- httplib.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/httplib.h b/httplib.h index 9a4db03..ede81e8 100644 --- a/httplib.h +++ b/httplib.h @@ -4467,7 +4467,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);