caddy: HTTP3 Client Certificate 421
With the following configuration (hostnames replaced), and accessing over HTTP3, Caddy responds 421 for subdomain1.
I think this is a bug because subdomain1 doesn’t have client_auth enabled.
subdomain1.tld {
respond * 200 {
body "Hi"
}
}
subdomain2.tld {
tls {
client_auth {
mode require_and_verify
trusted_ca_cert_file /etc/caddy/ca.crt
}
}
respond * 200 {
body "Hi2"
}
}
Without the tls directive accessing over h3 or with the tls directive accessing over h2, both subdomains can be accessed without issue.
With strict_sni_host insecure_off and the tls directive in place, subdomain1 can be accessed, and subdomain2 gets ERR_QUIC_PROTOCOL_ERROR. I suspect the ERR_QUIC_PROTOCOL_ERROR is probably due to my configuration or method of testing rather than Caddy though (chromium --origin-to-force-quic-on=subdomain1.tld:443,subdomain2.tld:443), given that the browser doesn’t bring up the 'Select a certificate` prompt.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 32 (16 by maintainers)
After upgrading quic-go, this problem is no more in latest caddy.
It is recommended that you avoid redacting public information like hostnames. And if you really want to, you should be using the
.exampleTLD set aside for placeholders.strict_sni_host is incompatible with http3 because of stdlib tls state handling, that will depend on stdlib fix.
caddy currently will enable strict_sni_host whenever tls_auth is enabled. Maybe we should track which hostname to check for sni matching in this case @mholt.
Yeah - you probably don’t need to enable h2c though, just specify h1 and h2, to disable h3. Enabling h2c only makes sense for port 80, and only if you have a specific need for it. Most don’t, because TLS is trivial with Caddy and h2c is only needed when the client can only do h2 but not h1, e.g. with gRPC.
What? 🤔
No, HTTP/3 is definitely very, very optional.
I hope the Go standard library will support it! (That’s also what is holding back this issue.)
1. Environment
1a. Operating system and version
1b. Caddy version (run
caddy versionor paste commit SHA)2. Description
2a. What happens (briefly explain what is wrong)
HTTP/3 requests are responded to with a 421 status code, as if they had an invalid SNI.
2b. Why it’s a bug (if it’s not obvious)
The SNI seems correct, and this only occurs over HTTP/3. I can’t imagine a legitimate reason that this wouldn’t occur over HTTP/2, so I believe the bug lies with Caddy.
2c. Log output
I have the full log, but this is the part that seems specific to the request. If you think there may be more to see, let me know.
I’ve redacted the remote IP addresses, since my current location is irrelevant.
2d. Workaround(s)
Disabling HTTP/3 (or simply opting not to use it when connecting) avoids the issue, as does removing
strict_sni_host.3. Tutorial (minimal steps to reproduce the bug)
Disabling HTTP/3 will cause the error to vanish.
With other domains excised (it continues after the first site block), the following is my Caddyfile:
Safari relies on the draft HTTPS DNS record to use HTTP/3, in case that’s relevant. If you don’t feel like manually decoding the wire format, I can give you those records in presentation format.
Given that this is an experimental feature, it is not impossible that the bug is actually Safari’s fault, and the Chrome issue is unrelated.