Skip to main content

Module sni

Module sni 

Source
Expand description

TLS ClientHello parsing, used to route a connection before any TLS handshake takes place.

The proxy peeks at the bytes a client sent without consuming them, reads the Server Name Indication (SNI) extension, and uses the hostname to decide whether to terminate TLS itself or splice the raw stream to a daemon that terminates TLS on its own. Because the bytes are only peeked, the same ClientHello is still there for whichever path is chosen.

Only the parts of RFC 8446 §4.1.2 / RFC 6066 §3 needed for that decision are parsed. Nothing here validates the handshake; rustls does that on the terminate path, and the daemon does it on the passthrough path.

Enums§

SniPeek
The outcome of looking for an SNI hostname in the bytes read so far.

Functions§

parse_sni
Look for an SNI hostname in buf, which holds the first bytes a client sent on a connection.