summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-01-23 19:37:13 +0100
committerFelix Fietkau <nbd@openwrt.org>2016-01-23 19:37:13 +0100
commit4fcd0174bab4f4237568e05fc6d552486e81ffa2 (patch)
treeede348d378c6bc6da565961fa5a780193fc06f04
parent334dce08589197d6571d4afa1aabc69891647daf (diff)
downloadustream-ssl-4fcd0174bab4f4237568e05fc6d552486e81ffa2.tar.gz
mbedtls: fix handling SSL close notification
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--ustream-mbedtls.c3
1 files changed, 3 insertions, 0 deletions
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;
}