ESP mbedTLS not detecting data drop
Posted: Thu Feb 07, 2019 7:40 am
Hello all,
I am having issues with mbedTLS in v3.1.2 IDF detecting when data connection is lost. I am setting up an SSL connection with our companies server and communicating by sending JSON packets. I have set the connection to non-blocking and I am calling mbedtls_ssl_read and mbedtls_ssl_write in timers. There is no issue with an active connection and messages are sent and received fine but once I turn off data to simulate a 4G dropout on our remote router mbedtls_ssl_read only ever returns MBEDTLS_ERR_SSL_WANT_READ and mbedtls_ssl_write continues to send messages and returns that they have been successfully sent.
I believe the issue has something to do with setting the connection as KEEP_ALIVE however I have not found much support for this with mbedTLS. Has anybody had a similar experience and been able to overcome this issue?
Thank you in advance for any assistance you may provide,
Quentin
I am having issues with mbedTLS in v3.1.2 IDF detecting when data connection is lost. I am setting up an SSL connection with our companies server and communicating by sending JSON packets. I have set the connection to non-blocking and I am calling mbedtls_ssl_read and mbedtls_ssl_write in timers. There is no issue with an active connection and messages are sent and received fine but once I turn off data to simulate a 4G dropout on our remote router mbedtls_ssl_read only ever returns MBEDTLS_ERR_SSL_WANT_READ and mbedtls_ssl_write continues to send messages and returns that they have been successfully sent.
I believe the issue has something to do with setting the connection as KEEP_ALIVE however I have not found much support for this with mbedTLS. Has anybody had a similar experience and been able to overcome this issue?
Thank you in advance for any assistance you may provide,
Quentin