pub unsafe extern "C" fn s2n_set_server_name(
    conn: *mut s2n_connection,
    server_name: *const c_char
) -> c_int
Expand description

Sets the server name for the connection.

The provided server name will be sent by the client to the server in the server_name ClientHello extension. It may be desirable for clients to provide this information to facilitate secure connections to servers that host multiple ‘virtual’ servers at a single underlying network address.

s2n-tls does not place any restrictions on the provided server name. However, other TLS implementations might. Specifically, the TLS specification for the server_name extension requires that it be an ASCII-encoded DNS name without a trailing dot, and explicitly forbids literal IPv4 or IPv6 addresses.

@param conn The connection object being queried @param server_name A pointer to a string containing the desired server name @warning server_name must be a NULL terminated string. @returns S2N_SUCCESS on success. S2N_FAILURE on failure