oa_gateway::addr

Function host_part

Source
pub(crate) fn host_part(value: &str) -> &str
Expand description

The host part of a configured host:port, without the port.

TLS server-name verification checks the name the operator configured, not whatever resolve_addr resolved it to — reversing a resolved SocketAddr back to a name would be both wrong (it is not necessarily the name that was configured) and impossible for a round-robin DNS record. Handles the bracketed IPv6 form: [::1]:61613 is ::1.