-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TLS connections don't close on errors #8
Comments
Guess, you are right: New version of the send function:
What about the receive function? Guess, it is valid for it too.
Are you OK with this version of functions? |
Sorry, I missed the notification, but that will do - at least it's working for me. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If using TLS connections, errors in the underlying FNET write or read functions won't cause the TLS connections to close as expected.
This error can be traced down to the callback functions "_fnet_tls_mbedtls_send" and "_fnet_tls_mbedtls_recv". If the underlying FNET connection returns FNET_ERR, these functions return 0, but according to the mbedtls documentation https://tls.mbed.org/api/ssl_8h.html#a38e2b400d361f42f85833cdc30b3916e, the callback must return the number of bytes sent if any, or a non-zero error code.
To fix that, just return -1 or simply remove the else-if-clause.
The text was updated successfully, but these errors were encountered: