mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-25 13:43:31 +00:00
ssl_client1: Exit with an error status if the TLS connection failed
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
1dbfb4b8e2
commit
dd51826b4e
@ -240,6 +240,9 @@ int main(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
|
if (ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
|
||||||
|
mbedtls_printf("The return value %d from mbedtls_ssl_read() means that the server\n"
|
||||||
|
"closed the connection first. We're ok with that.\n",
|
||||||
|
MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -259,7 +262,9 @@ int main(void)
|
|||||||
|
|
||||||
mbedtls_ssl_close_notify(&ssl);
|
mbedtls_ssl_close_notify(&ssl);
|
||||||
|
|
||||||
|
if (ret == 0 || ret == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
|
||||||
exit_code = MBEDTLS_EXIT_SUCCESS;
|
exit_code = MBEDTLS_EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user