-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DNS-over-TLS error "EOF" #276
Comments
Hi, I copied your config with minor changes in terms of SNI and upstreams:
DoT works perfectly with the q client on Windows as follows:
DoT also works fine with the dig client on Linux as follows:
I don't know if these is any difference in DoT handling by dig, kdig and q. But it seems |
That's really strange. I get exactly the same behavior when specifying "+notls-ca" in both. What does |
What if you try the q client on Linux? |
I also tried I'm not sure whether it's a problem with caddy-l4 or the various tools not implementing TLS handshake (or whatever) correctly. Nevertheless as it works with nginx and dig when providing or importing the CA cert I suspect Caddy not providing the correct data here? Unfortunately I know almost nothing about TLS, so where do I start debugging? Something I noticed with CA certificates being trusted: apparently in SNI the hostname is never sent with dig.
Without SNI matching the dig command above results in:
So apparently dig and kdig don't send any hostname? I'll have a look at https://datatracker.ietf.org/doc/html/rfc7858 and try to understand whether DoT is supposed to support SNI. |
I'm trying to get DNS-over-TLS (DoT) running with the l4 module with the following config.
After some tinkering I'm stuck at TLS termination and getting a response from upstream, unless its "pure" DNS. What am I missing?
(I hope it's OK to ask here.)
HTTPS is good
curl -i --cacert data/caddy/pki/authorities/local/intermediate.crt https://dns.localhost
DNS works
dig @127.0.0.1 -p1053 caddyserver.com
DNS-over-TLS returns an error
dig fails (without output)
dig -d @127.0.0.1 +tls +tls-ca=data/caddy/pki/authorities/local/root.crt +tls-hostname=dns.localhost caddyserver.com
kdig provides more info and causes EOF
kdig -d @127.0.0.1:853 +tls-ca=data/caddy/pki/authorities/local/root.crt +tls-hostname=dns.localhost caddyserver.com
Comparing to nginx
A comparable nginx setup with ngx_stream_core_module works. I had to add the root certificate to
dns.localhost.crt
though, only the intermediate would not work.dig @127.0.0.1 +tls +tls-ca=data/caddy/pki/authorities/local/root.crt +tls-hostname=dns.localhost caddyserver.com
To make it easier to reproduce, here's how I'm running Caddy.
Dockerfile
Build and run
The text was updated successfully, but these errors were encountered: