pub struct QuicTarget {
pub addr: SocketAddr,
pub server_name: String,
}Expand description
Where packets go, and whose certificate to expect when they arrive.
Two fields and not one host:port string, because they are two different
things and a public relay is where that stops being pedantry. The socket
layer needs an address it can send to; the TLS layer needs the name a
certificate was issued for. Deriving the second from the first — which is
what a single string forces — leaves only bad options: dial the hostname
and parse::<SocketAddr>() rejects it, or resolve first and then validate
a public relay’s certificate against an IP literal that no CA ever put in
a SAN. dial_quic is where both are avoided.
Fields§
§addr: SocketAddrThe address packets are sent to. Already resolved — nothing in this module does DNS on it.
server_name: StringThe name offered in SNI and validated against the server’s certificate.
An IP literal is legal and is what a loopback peer holding an IP-SAN certificate wants; a hostname is what a public relay wants. Keeping it separate is what lets one caller ask for both against one address.