Skip to content

Commit

Permalink
net: sockets: tls: Use better error code
Browse files Browse the repository at this point in the history
Mbed TLS 3.0 removes the definition for MBED_ERR_SSL_PEER_VERIFY_FAILED,
since non of its code ever returns that value.  Since there isn't really
a perfect response, instead return a somewhat generic response
indicating this was unexpected.

Signed-off-by: David Brown <[email protected]>
  • Loading branch information
d3zd3z authored and galak committed Oct 7, 2021
1 parent 26a630b commit fc3f4a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions subsys/net/lib/sockets/sockets_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ LOG_MODULE_REGISTER(net_sock_tls, CONFIG_NET_SOCKETS_LOG_LEVEL);

static const struct socket_op_vtable tls_sock_fd_op_vtable;

#ifndef MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED
#define MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE
#endif

/** A list of secure tags that TLS context should use. */
struct sec_tag_list {
/** An array of secure tags referencing TLS credentials. */
Expand Down

0 comments on commit fc3f4a6

Please sign in to comment.