feat(http): DohResolver, DNS over HTTPS in std/http (#70) #421
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/70-doh-resolver"
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?
Closes #70
DohResolverinstd/http(newstd/http/src/doh.trb, exported fromlib.trb), DNS over HTTPS (RFC 8484, DNS.md slice 6) in the shape ofTlsResolver.What
DohResolver { url: Uri, tls: TlsSettings = TlsSettings(), attemptMilliseconds: Int = 5000 }withlookupandexchange, same contract asTlsResolver: NXDOMAIN isisHostNotFound();SERVFAIL/REFUSED/NOTIMP, a non-DNS body, a non-2xx status (status in the message) and a scheme other thanhttps(refused before any connection) areisNameServerFailure(); the attempt's time passing isisTimedOut(); a server that cannot prove the URL's host isisCertificateRejected().exchangesendsquery(name, type, 0)(identifier 0, RFC 8484 section 4.1) as aPOSTwithContent-TypeandAcceptofapplication/dns-messagethrough the existingsend, reads the body bounded to 65535 bytes and checks it withreadResponse.HttpError.networkFailure()(new, small): theNetworkErrorunder anHttpError(a timeout as a timeout, anything else as a name server failure), sincestd/networkcannot knowHttpErrorand the kind is private toerror.trb.tests/conformance/dns-over-https.trb: an HTTPS server written in the test (loopback, test root as indns-over-tls.trb) with recorded responses: address, CNAME chain, NXDOMAIN,SERVFAIL, non-DNS body,503, silent server; it answers400to any request that is not aPOSTwith both media types and identifier 0, and one route echoes what it saw. Untrusted root and platform roots are refused; anhttp://URL is refused with no connection opened (a listener on its port sees none).docs/standard-library/http.md(declarations, example) and ROADMAP;skills/copies updated to match the generator's output.Seed
No seed impact: TorbScript only in
std/http, no syntax, no new native, no std name looked up by the compiler.Out of scope (unchanged)
The
Clientoption that resolves hosts through a resolver (next step, filed once this has landed), GET with?dns=, HTTP/2, kept connections, caching, HTTPS/SVCB, DNSSEC.Test
Forge CI only (no bootstrap or gates in the worker's exec); result below once CI has run.
CI red on
8fc2dab:tier A (linux-x64)(failing after 4m55s),tools/release-sync and tools/registry (linux-x64)(failing after 45s);every host emits the same Candgatesfollow from them. Cause not visible to the review account (job logs are not readable via the API); main is green, so it is not inherited. Note:tier Aalso fails on #422 (bc1c71a) after a similar time, so check whether it is a shared cause before attributing it to the new conformance testtests/conformance/dns-over-https.trb. No review yet: my request stays pending and the next green CI run brings me back.Cause of the red
tier Aon8fc2dab:torb format --checkwould changestd/http/src/error.trbandtests/conformance/dns-over-https.trb(call layout only). Fixed in9e64636(formatter output, no behaviour change);format --check std/httpis clean now.tools/release-sync and tools/registrywas a runner failure (context canceled, all 66 tests passed),every host emits the same Candgatesfollowed from the red jobs. Review re-requested.CI red on
9e64636:commit messages(failing after 3s). Cause:tools/check-commits.shaccepts only the types feat|fix|perf|refactor|docs|test|build|ci|chore|revert, and the new commit9e64636has the subjectstyle(http): lay out DohResolver code as torb format asks;styleis not an allowed type. Fix: reword that subject (e.g.chore(http): ...orrefactor(http): ...) or fold the commit into23a1a80, then force-push. All other checks on this head are green (tier A, tools, every host emits the same C, gates, pdisc). No review yet: my request stays pending and the next green CI run brings me back.9e646368f92af2fcc9d0commit messagesred on9e64636:styleis not an allowed type intools/check-commits.sh. Reworded the subject tochore(http): lay out DohResolver code as torb format asks(tree unchanged, message only), force-pushed as2af2fcc;tools/check-commits.sh origin/main HEADpasses locally. Review re-requested.Checklist (head
2af2fcc, CI combined status success):dns-over-https.trbcovers address, CNAME chain, NXDOMAIN, SERVFAIL, non-DNS body, 503 (status in message), timeout, untrusted root, platform roots andhttp://refusal with no connection; the test server answers 400 unless the request is a POST with both media types and identifier 0, and/inspectechoes what it saw.isTimedOut(),HttpError.networkFailure()maps kinds sensibly.Non-blocking: none.