Update DoH references, point to RFC 8484
DoH is now a standard, published as RFC 8484. This patch updates the
references to it accordingly.
Alberto Bertogli
3 years ago
12 | 12 |
|
13 | 13 |
## Features
|
14 | 14 |
|
15 | |
* Supports the JSON-based protocol as implemented by
|
|
15 |
* Supports the
|
|
16 |
[DNS Queries over HTTPS (DoH)](https://en.wikipedia.org/wiki/DNS_over_HTTPS)
|
|
17 |
standard ([RFC 8484](https://tools.ietf.org/html/rfc8484).
|
|
18 |
* Supports the older JSON-based protocol as implemented by
|
16 | 19 |
[dns.google](https://dns.google)
|
17 | 20 |
([reference](https://developers.google.com/speed/public-dns/docs/dns-over-https)).
|
18 | |
* Supports the [DNS Queries over HTTPS
|
19 | |
(DoH)](https://tools.ietf.org/html/draft-ietf-doh-dns-over-https) proposed
|
20 | |
standard (and implemented by [Cloudflare's 1.1.1.1](https://1.1.1.1/)).
|
21 | 21 |
* Local cache (optional).
|
22 | 22 |
* HTTP(s) proxy support, autodetected from the environment.
|
23 | 23 |
* Monitoring HTTP server, with exported variables and tracing to help
|
24 | 24 |
// server via DNS over HTTPS.
|
25 | 25 |
//
|
26 | 26 |
// It supports two modes: JSON (like https://dns.google) and DoH
|
27 | |
// (https://tools.ietf.org/html/draft-ietf-doh-dns-over-https-12).
|
|
27 |
// (https://en.wikipedia.org/wiki/DNS_over_HTTPS, RFC 8484).
|
28 | 28 |
type httpsResolver struct {
|
29 | 29 |
Upstream *url.URL
|
30 | 30 |
CAFile string
|
5 | 5 |
// https://developers.google.com/speed/public-dns/docs/dns-over-https#api_specification.
|
6 | 6 |
// This is also implemented by Cloudflare's 1.1.1.1, as documented in:
|
7 | 7 |
// https://developers.cloudflare.com/1.1.1.1/dns-over-https/json-format/.
|
8 | |
// - DNS Queries over HTTPS (DoH), as specified in:
|
9 | |
// https://tools.ietf.org/html/draft-ietf-doh-dns-over-https-12.
|
|
8 |
// - DNS Queries over HTTPS (DoH), as specified in RFC 8484:
|
|
9 |
// https://tools.ietf.org/html/rfc8484.
|
10 | 10 |
package httpserver
|
11 | 11 |
|
12 | 12 |
import (
|
|
324 | 324 |
return false, errInvalidCD
|
325 | 325 |
}
|
326 | 326 |
|
327 | |
// Resolve DNS over HTTPS requests, as specified in
|
328 | |
// https://tools.ietf.org/html/draft-ietf-doh-dns-over-https-12.
|
|
327 |
// Resolve DNS over HTTPS requests, as specified in RFC 8484.
|
329 | 328 |
func (s *Server) resolveDoH(tr trace.Trace, w http.ResponseWriter, dnsQuery []byte) {
|
330 | 329 |
r := &dns.Msg{}
|
331 | 330 |
err := r.Unpack(dnsQuery)
|