From 4fcd0174bab4f4237568e05fc6d552486e81ffa2 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 23 Jan 2016 19:37:13 +0100 Subject: [PATCH] mbedtls: fix handling SSL close notification Signed-off-by: Felix Fietkau --- ustream-mbedtls.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ustream-mbedtls.c b/ustream-mbedtls.c index 7fbfba5..e176afe 100644 --- a/ustream-mbedtls.c +++ b/ustream-mbedtls.c @@ -316,6 +316,9 @@ __hidden int __ustream_ssl_read(struct ustream_ssl *us, char *buf, int len) if (ssl_do_wait(ret)) return U_SSL_PENDING; + if (ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) + return 0; + ustream_ssl_error(us, ret); return U_SSL_ERROR; } -- 2.25.1