Skip to content

fix: allow TLS handshakes without SNI - #9

Merged
losfair merged 1 commit into
losfair:mainfrom
losfair-bot:fix/allow-no-sni
Oct 28, 2026
Merged

losfair merged 1 commit into
losfair:mainfrom
losfair-bot:fix/allow-no-sni

Conversation

@losfair-bot

Copy link
Copy Markdown

Summary

Allow TLS handshakes that omit SNI, while preserving the allowlist check whenever SNI is present.

The client already deliberately omits SNI for IP-literal endpoints and verifies the server certificate's IP SAN (ClientTls::start_session). The server's unconditional rejection of missing SNI prevented that supported client path from connecting, including when using an IP-address certificate from Let's Encrypt.

This changes only the missing-SNI branch of the server certificate-selection callback. Present, unmatched SNI (including ECH inner SNI) is still rejected. CONNECT-UDP authority/path matching and pinned forwarding targets are unchanged; allowing the handshake is not permission to use an arbitrary target.

Regression coverage

  • Real QUIC/TLS handshakes succeed without SNI for IPv4 and IPv6 certificate identities, with certificate verification enabled.
  • Server-side handshake data confirms SNI is actually absent.
  • IP SAN mismatches and untrusted certificates still fail.
  • Existing unmatched-SNI and ECH tests continue to pass.
  • README describes the no-SNI behavior and its access-control implications.

Validation

  • Reproduced the new positive regression test failing against the original server with TLS handshake failed: [CONNECTION_REJECTED].
  • The same test passes after the fix.
  • cargo fmt --all -- --check
  • cargo test --locked — 73 passed, 0 failed.
  • cargo clippy --locked --all-targets -- -D warnings

No deployed router binary, certificate, or firewall configuration is changed by this PR.

@losfair
losfair merged commit 50374de into losfair:main Oct 28, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants