summaryrefslogtreecommitdiff
path: root/lib/vtls/wolfssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vtls/wolfssl.c')
-rw-r--r--lib/vtls/wolfssl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c
index 60e27e366..8d217ec54 100644
--- a/lib/vtls/wolfssl.c
+++ b/lib/vtls/wolfssl.c
@@ -810,6 +810,10 @@ static void wolfssl_close(struct Curl_easy *data, struct connectdata *conn,
(void) data;
if(backend->handle) {
+ char buf[32];
+ /* Maybe the server has already sent a close notify alert.
+ Read it to avoid an RST on the TCP connection. */
+ (void)SSL_read(backend->handle, buf, (int)sizeof(buf));
(void)SSL_shutdown(backend->handle);
SSL_free(backend->handle);
backend->handle = NULL;