Unverified Commit 5c224020 authored by Juraj Andrássy's avatar Juraj Andrássy Committed by GitHub

fix: ClientSecure.available() fix for connection closed by remote socket (#9869)

parent 1efab834
...@@ -305,9 +305,11 @@ int NetworkClientSecure::available() { ...@@ -305,9 +305,11 @@ int NetworkClientSecure::available() {
res = data_to_read(sslclient.get()); res = data_to_read(sslclient.get());
if (res < 0 && !_stillinPlainStart) { if (res < 0 && !_stillinPlainStart) {
log_e("Closing connection on failed available check"); if (res != MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
log_e("Closing connection on failed available check");
}
stop(); stop();
return peeked ? peeked : res; return peeked;
} }
return res + peeked; return res + peeked;
} }
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
const char *pers = "esp32-tls"; const char *pers = "esp32-tls";
static int _handle_error(int err, const char *function, int line) { static int _handle_error(int err, const char *function, int line) {
if (err == -30848) { if (err == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
return err; return err;
} }
#ifdef MBEDTLS_ERROR_C #ifdef MBEDTLS_ERROR_C
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment