--proxy snippets: nginx answers 421 for any other name on its TLS port #51

Merged
jcoffey-dev merged 1 commits from fix/48-421-fallback into main 2026-11-08 23:13:03 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev cdfff73f73 --proxy snippets: nginx answers 421 for any other name on its TLS port (#48)
ci / test (pull_request) Successful in 1m51s
A browser reuses an HTTP/2 connection for every name its certificate
covers. With one certificate for the console's, the webmail's and the
mail server's names, a request for the mail server can arrive over the
webmail's connection, past the router, and nginx answered it as the
webmail or the console. A default server on 127.0.0.1:8444 now answers
any name but those two with 421 Misdirected Request, so the browser
opens a connection of its own for it, and the router passes that one
through. It needs no certificate: ssl_reject_handshake refuses a
handshake for any other name, and the router sends none.

The reporter of #48 pointed this out. Checked against nginx 1.26 with
one certificate for all three names: their own names reach the console
and the webmail, anything else gets 421; the e2e case checks it too.
2026-11-08 15:53:00 -07:00