dns: DNS over HTTPS (DNS slice 6) #70
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
DNS over HTTPS (RFC 8484) for
std/http, DNS.md slice 6. Slices 1 to 5 (std/dns, UDP, TCP, DoT) and NETWORK.md slice 7 (Client) are built, so the pieces exist:query(name, type, id)andreadResponse(bytes, query)ofstd/dns, andTlsResolverinstd/tlsas the shape to follow ("the same two calls around another pipe", DNS.md section 1).This issue is the first step: the resolver type. Making a
Clientuse it to connect (the "option of the client" wording of the slice table) is the next step and is filed when this one has landed, because it needs a decision on a resolver abstraction thatResolver,TlsResolverand the new type share.Source
POSTofapplication/dns-message, identifier 0"), 7 (slice 6, "Lookups, as built") and 8std/tls/src/lib.trbTlsResolver(shape, error mapping),std/http/src/pool.trbClientScope
A new
DohResolverinstd/http(new filestd/http/src/doh.trb, exported fromlib.trb), the shape ofTlsResolver:url: Uri(the server'shttpsendpoint, e.g.https://dns.example.test/dns-query),tls: TlsSettings = TlsSettings(),attemptMilliseconds: Int = 5000.fn lookup(name: DomainName, recordType: RecordType): Task<Result<List<Record>, NetworkError>>andfn exchange(name, recordType): Task<Result<Message, NetworkError>>, same contract asTlsResolver(NXDOMAIN isisHostNotFound(),SERVFAIL/REFUSED/NOTIMPand a non-DNS body areisNameServerFailure(), the attempt's time passing isisTimedOut()).exchangesendsquery(name, type, 0)(identifier 0, RFC 8484 section 4.1) as aPOSTwithContent-TypeandAcceptofapplication/dns-messagethrough the existing client code, and reads the body (bounded) withreadResponse.httpsand a non-2xx status are failures (isNameServerFailure()with the status in the message); anHttpErrorof the exchange maps to the matchingNetworkError.std/http's" bullet in section 7 replaced by the as-built description, section 2's tree and table updated.Acceptance criteria
DohResolverwithlookupandexchangeas above, public and documented (torb doc --checkclean), imported fromstd/http.tests/conformance/dns-over-https.trbruns natively and in the VM against a DoH server written in the test itself (loopback, TLS with a test root asdns-over-tls.trbdoes), with recorded response bytes: an address answer, a CNAME chain, NXDOMAIN,SERVFAIL, a non-DNS body, a non-2xx status, and a silent server timing out. It asserts the request: methodPOST, both media types, identifier 0 in the body.http://URL is refused without a connection being opened.skills/regenerated if docs change it.Seed
No seed impact expected: TorbScript only in
std/http(importingstd/dns, which has no natives), no syntax, no new native, no name the compiler looks up by string.Out of scope
Clientoption that resolves hosts through a resolver (next step, after this one).?dns=base64url form, HTTP/2 (NETWORK.md slice 12), keeping connections alive across lookups, caching.Dependencies
None open: DNS.md slices 1 to 5 and NETWORK.md slice 7 are done.
Size: one PR, one or two Conventional Commits (
feat(http): ...,docs(dns): ...).Moved from the planning lists of the docs; the design record stays the specification.
[loop:torbscript] intake: in scope (author orion, label loop), source DNS.md slice 6 (RFC 8484), not a duplicate, no collision with a design record. TorbScript in
std/http, tests with recorded responses, no seed impact expected. next: refine, waiting (ready buffer full: #4, #163, #164, #223 are ready) until 2026-10-10T04:00:00Z[loop:torbscript] claim refine by session:loop-torbscript-20261023 until 2026-10-23T10:04:00Z
[loop:torbscript] refine: dependencies checked (DNS.md slices 1 to 5 and NETWORK.md slice 7 are built;
std/dns,TlsResolverandClientare onmain), keyword search over open and closed issues (DoH, DNS over HTTPS, 8484, dns-message, resolver) found no duplicate. decided by the loop: slice 6 as written is "a resolver option of the client", which is two changes (a DoH resolver type, then theClientusing a resolver to connect, which needs a shared resolver abstraction and its own design choice). This issue is narrowed to the first one,DohResolverinstd/httpin the shape ofTlsResolver(one new file, one conformance program, DNS.md update, one or two commits, no seed impact); theClientoption is filed as the next step once this has landed (just in time, not up front). Scope, acceptance criteria and out-of-scope are rewritten in the issue body. next: ready (label set), implement.[loop:torbscript] claim implement by session:loop-torbscript-20261023 until 2026-10-23T14:16:00Z