Skip to content
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

dnsdist 1.9.0-pre does not seem to respond well to DoH3 POST #13687

Closed
2 tasks done
hlindqvist opened this issue Jan 9, 2024 · 0 comments · Fixed by #13689
Closed
2 tasks done

dnsdist 1.9.0-pre does not seem to respond well to DoH3 POST #13687

hlindqvist opened this issue Jan 9, 2024 · 0 comments · Fixed by #13689
Assignees
Milestone

Comments

@hlindqvist
Copy link
Contributor

  • Program: dnsdist
  • Issue type: Bug report

Short description

Environment

  • Operating system: Debian
  • Software version: 1.9.0-pre / master
  • Software source: compiled myself

Steps to reproduce

  1. Run dnsdist with DoH2 and DoH3 endpoints. Something to the effect of:
v = "127.0.0.1"
addDOHLocal(v, '/etc/dnsdist/cert/fullchain.pem', '/etc/dnsdist/cert/privkey.pem', '/dns-query',{ customResponseHeaders={ ["alt-svc"]= "h3=\":443\"; ma=3600" } })
addDOH3Local(v, '/etc/dnsdist/cert/fullchain.pem', '/etc/dnsdist/cert/privkey.pem')
newServer("9.9.9.9")
  1. Prepare a file with post data
base64 -d <<EOF >decoded
AAABAAABAAAAAAAAA3d3dwdleGFtcGxlA2NvbQAAAQAB
EOF
  1. Send an initial query over h2 (discovering alt-svc, works fine)
curl -v --alt-svc altsvcrepo.txt -H 'accept: application/dns-message' -H 'content-type: application/dns-message' -XPOST 'https://dns.example/dns-query' --data-binary @decoded -o response-h2
  1. Send the query over h3 (get stuck somehow?)
curl -v --alt-svc altsvcrepo.txt -H 'accept: application/dns-message' -H 'content-type: application/dns-message' -XPOST 'https://dns.example/dns-query' --data-binary @decoded -o response-h3
  1. Send the query over h3 but using GET (works fine)
curl -v --alt-svc altsvcrepo.txt -H 'accept: application/dns-message' -H 'content-type: application/dns-message' 'https://dns.example/dns-query?dns=AAABAAABAAAAAAAAA3d3dwdleGFtcGxlA2NvbQAAAQAB' -o response-h3-get
  1. Entirely for reference h3 POST to Cloudflare (works fine)
curl -v --http3 -H 'accept: application/dns-message' -H 'content-type: application/dns-message' -XPOST 'https://1.1.1.1/dns-query' --data-binary @decoded -o response-h3-cf

Expected behaviour

All the above responses should be equivalent (and the response-* files should be created with equivalent contents)

Actual behaviour

All files but response-h3 are ok. response-h3 is not even created because of the request somehow failing.

Other information

  1. I have seen Chrome(ium) fail completely when exposed to dnsdist's h3 as well, this is what led me down this path. I haven't really figured out the Chrome(ium) logging fully but at least it ends up with this failure after doing the h3 POST to the DOH endpoint (but works fine with same dnsdist setup only doing h2):
t=109 [st=1]       -HOST_RESOLVER_MANAGER_REQUEST
                    --> net_error = -800 (ERR_DNS_MALFORMED_RESPONSE)
t=109 [st=1]     -TRANSPORT_CONNECT_JOB_CONNECT
                  --> net_error = -105 (ERR_NAME_NOT_RESOLVED)
  1. You probably have better tooling for looking at DNS messages, but as a simple pretty-printer I used:
#!/usr/bin/env python3

import dns.message
import io

f = open("file-with-message", mode="rb")
f2 = io.BytesIO(f.read())
msg = dns.message.from_wire(f2.getvalue())

print(msg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants