Skip to main content

canonicalize_dns_host

Function canonicalize_dns_host 

Source
pub fn canonicalize_dns_host(id_tag: &str) -> ClResult<Cow<'_, str>>
Expand description

Canonical form of a DNS host name — the same UTS #46 U-label canonicalize_id_tag produces, without the id_tag length policy.

ID_TAG_MIN_LEN/ID_TAG_MAX_LEN are a registration rule, not a DNS rule. The two inbound boundaries that have to decode a host they did not choose — the TLS SNI name and the HTTP Host header — must accept any name DNS itself accepts, or a short but perfectly valid id_tag stops resolving. DNS validity is still enforced by DnsLength::Verify and the STD3 ASCII deny list, so /, :, whitespace and _ remain impossible here.

Borrows when the input is already canonical.