From ce00ac4a29b8a096c2e9158e571ee4c4c1273f32 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 12 Feb 2025 23:35:54 +0100 Subject: [PATCH] Update the documentation of ssl->hostname Signed-off-by: Gilles Peskine --- include/mbedtls/ssl.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h index 42fffbf86..a7bfd7bde 100644 --- a/include/mbedtls/ssl.h +++ b/include/mbedtls/ssl.h @@ -1884,8 +1884,16 @@ struct mbedtls_ssl_context { * User settings */ #if defined(MBEDTLS_X509_CRT_PARSE_C) - char *MBEDTLS_PRIVATE(hostname); /*!< expected peer CN for verification - (and SNI if available) */ + /** Expected peer CN for verification. + * + * Also used on clients for SNI, + * and for TLS 1.3 session resumption using tickets. + * + * If this is \p NULL, the peer name verification is skipped, + * the server_name extension is not sent, and the server name is ignored + * in TLS 1.3 session resumption using tickets. + */ + char *MBEDTLS_PRIVATE(hostname); #endif /* MBEDTLS_X509_CRT_PARSE_C */ #if defined(MBEDTLS_SSL_ALPN)