Function esp_idf_svc::hal::sys::mbedtls_ssl_set_hostname

source ยท
pub unsafe extern "C" fn mbedtls_ssl_set_hostname(
    ssl: *mut mbedtls_ssl_context,
    hostname: *const i8,
) -> i32
Expand description

\brief Set or reset the hostname to check against the received server certificate. It sets the ServerName TLS extension, too, if that extension is enabled. (client-side only)

\param ssl SSL context \param hostname the server hostname, may be NULL to clear hostname

\note Maximum hostname length MBEDTLS_SSL_MAX_HOST_NAME_LEN.

\return 0 if successful, MBEDTLS_ERR_SSL_ALLOC_FAILED on allocation failure, MBEDTLS_ERR_SSL_BAD_INPUT_DATA on too long input hostname.

            Hostname set to the one provided on success (cleared
            when NULL). On allocation failure hostname is cleared.
            On too long input failure, old hostname is unchanged.