PowerDNS / pdns

PowerDNS Authoritative, PowerDNS Recursor, dnsdist
https://www.powerdns.com/
GNU General Public License v2.0
3.73k stars 915 forks source link

DNS over HTTP3 - no SNI for Apple devices #14048

Open realbugi opened 8 months ago

realbugi commented 8 months ago

Short description

dnsdist does not provide requested domain with lua (getServerNameIndication, getHTTPHost) over HTTP3 for Apple devices.

Environment

Steps to reproduce

  1. Setup dnsdist according to this example
    
    addDOH3Local("0.0.0.0:443", "dns.crt", "dns.key", { reusePort=true })

function show_domain(dq) pdnslog('protocol: ' .. dq:getProtocol() .. ' SNI: ' .. dq:getServerNameIndication() .. ' HOST: ' .. dq:getHTTPHost()) end

addAction(AllRule(), LuaAction(show_domain))

2. Send request to dnsdist from Apple device

### Expected behaviour
<!-- What would you expect to happen when the reproduction steps are run -->
Domain requested by device is showed by `getHTTPHost` or `getServerNameIndication` action

### Actual behaviour
<!-- What did happen? Please (if possible) provide logs, output from `dig` and/or tcpdump/wireshark data -->

Apr 07 00:20:55 trubadur dnsdist[1212653]: protocol: DNS over HTTP/3 SNI: HOST:



### Other information
<!-- if you already did more digging into the issue, please provide all the information you gathered -->
This bug does not occur with Firefox browser over DoH3 and no problems with DoH.
rgacogne commented 7 months ago

Thanks for filling this issue! The DoH3 feature is not yet at feature parity with the existing DoH code, and SNI and HTTP attributes are indeed not exposed to Lua at the moment. We are planning on fixing this gap in the next major version, and will likely backport it to 1.9.x if it's not too invasive.