This is a discussion topic.
Caddy recently added an option to request wildcards instead of individual certs. This feature in combination with strict_sni_host=true flag causes problems.
Firefox & Chrome try to use a connection setup for a.home.arpa for a request to b.home.arpa. The certificate in use is valid for *.home.arpa and strict_sni_host is set to true. In this situation, The browser receives a 421 Misdirected Request message.
I read the RFC and in this situation, the HTTP client may retry request with a fresh connection but the browsers don’t seem to be doing that. Instead, It stays at the 421 Misdirect Request response page until I hit refresh and then it works.
Why do I want strict_sni_host=true ?
I like this flag a lot because it keeps junk easily filterable / outside of my logs. I do not want to see traffic from bots just fishing for things. (I also like default_sni=null!)
My suggestion:-
Can we modify strict_sni_host to be no, loose, yes ?
no=> maps to thefalsebehavior right now.yes=> maps to thetruebehavior right now.loose=> allow any host configured in that Caddy proxy instance.
So, strict_sni_host=loose will allow a request to b.home.arpa done over a connection setup for a.home.arpa because both a.home.arpa and b.home.arpa are configured in the same proxy config.
I have seen a fair bit of 421 responses since I configured wildcards certificates for my homelab and a number of API failures. I have not seen any HTTP clients that actually immediately retry a request with a new connection. Most seem to kill the connection and setup a new one whenever they need to access the service again.