#[no_mangle]
pub extern "C" fn rustls_server_connection_get_server_name(
conn: *const rustls_connection,
buf: *mut u8,
count: size_t,
out_n: *mut size_t,
) -> rustls_result
Expand description
Copy the server name from the server name indication (SNI) extension to buf
.
buf
can hold up to count
bytes, and the length of that server name in out_n
.
The string is stored in UTF-8 with no terminating NUL byte.
Returns RUSTLS_RESULT_INSUFFICIENT_SIZE if the SNI hostname is longer than count
.
Returns Ok with *out_n == 0 if there is no SNI hostname available on this connection because it hasn’t been processed yet, or because the client did not send SNI. https://docs.rs/rustls/latest/rustls/server/struct.ServerConnection.html#method.server_name