I was using Caddy with no problems but it suddenly stopped working after I switched my pihole 6 installation from a proxmox lxc (where it was lagging horribly) to a bare metal Pi3. I put it down to the DNS, and maybe that was the cause but the solution was to remove the wildcard at the top of the Caddyfile.
I was using a wildcard *.local certificate but Firefox rejected it because it didn’t match dns.local.
Removing the *.local section from the Caddyfile fixed it once I had installed the root.crt in Firefox. I use a proxmox script for the caddy installation and it puts the certificates in
/var/lib/caddy/.local/share/caddy/pki/authorities/local/