1. The problem I’m having:
The recent issue with HTTP/3 and iOS18 caused me to upgrade Caddy to the latest master branch. Which solved that issue but has caused a new one.
I have Caddyfile config as seen below which uses a named matcher to allow a request if it matches a list of IP address ranges, or asks for Basic Auth if it doesn’t. This worked fine until I upgraded from 2.8.4 to master.
I now see Caddy send Firefox the www-authenticate header and a 401 response on the first request after being idle for 30 seconds or so causing a request for username/password. If I cancel the dialog and press refresh the page loads fine with a 200.
I have bisected the exact commit that causes this which is Reject 0-RTT early data in IP matchers and set Early-Data header when proxying
If I go into about:config and toggle network.http.http3.enable_0rtt then this behaviour goes away. So this is obviously the problem.
Note that this is not a problem in Edge, Chrome, or Safari. So I assume it’s only Firefox that enables 0-RTT.
2. Error messages and/or full log output:
192.168.0.1 - - "GET /unread HTTP/3.0" 401 16 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0"
I’m using the log transformer plugin here so this isn’t the JSON format. But you can see 401.
3. Caddy version:
v2.8.5-0.20240925120048-9dda8fbf846d h1:At3iU625S0FqzmJYSOHih0vPqvko8CqJY5igbDUW0lE=
4. How I installed and ran Caddy:
a. System environment:
Fedora Linux 40 amd64. Running docker-hub builder image using podman.
b. Command:
N/A
c. Service/unit/compose file:
N/A
d. My complete Caddy config:
I have only provided the relevant parts here, but I believe I’ve provided more than enough information already that this shouldn’t be a problem. If you do require the entire Caddyfile I’ll provide afterwards.
(auth) {
@auth{args[0]} {
not remote_ip 127.0.0.1 ::1 fe80::/10 192.168.0.0/16
path {args[0]}
}
basic_auth @auth{args[0]} {
user <redacted hash>
}
}
www.example.com {
reverse_proxy 127.0.0.1:8080
import auth /*
}