coredns/middleware/httpproxy/tls.go
Miek Gieben 4cfd19c7c9 middleware/httpproxy: add debug queries (#446)
* middleware/httproxy: implement debug queries

Not too useful at the moment, but o-o.debug queries are supported
and return the Comment from dns.google.com.

Note that this is not always set.

* improve documentation

* Testing cleanups
2016-11-29 09:54:57 +00:00

33 lines
608 B
Go

package httpproxy
import (
"crypto/tls"
"net/http"
"time"
"github.com/miekg/coredns/request"
"github.com/miekg/dns"
)
// Exchanger is an interface that specifies a type implementing a DNS resolver that
// uses a HTTPS server.
type Exchanger interface {
Exchange(request.Request) (*dns.Msg, error)
SetUpstream(*simpleUpstream) error
OnStartup() error
OnShutdown() error
}
func newClient(sni string) *http.Client {
tls := &tls.Config{ServerName: sni}
c := &http.Client{
Timeout: time.Second * timeOut,
Transport: &http.Transport{TLSClientConfig: tls},
}
return c
}
const timeOut = 5