Documentation ¶
Index ¶
- Constants
- func GetDialFunc(rs Resolver) func(network string, addr string) (net.Conn, error)
- func GetTLSAPrefix(host string) string
- func NewAuthority(name, organization string, validity time.Duration) (*x509.Certificate, *rsa.PrivateKey, error)
- func RoundTripper(rs Resolver, gContext *goproxy.ProxyCtx) http.RoundTripper
- func TLSASupported(rrs []dns.TLSA) bool
- type ClientResolver
- type Config
- type Resolver
Constants ¶
const ( Timeout = 30 * time.Second KeepAlive = 30 * time.Second TLSHandshakeTimeout = 10 * time.Second ExpectContinueTimeout = time.Second )
Timeouts used in the dialer and http transport.
Variables ¶
This section is empty.
Functions ¶
func GetDialFunc ¶
GetDialFunc returns a dial function that uses the given resolver.
func GetTLSAPrefix ¶
GetTLSAPrefix returns the TLSA prefix for the given host:port
func NewAuthority ¶
func NewAuthority(name, organization string, validity time.Duration) (*x509.Certificate, *rsa.PrivateKey, error)
NewAuthority creates a new CA certificate and associated private key.
func RoundTripper ¶
func RoundTripper(rs Resolver, gContext *goproxy.ProxyCtx) http.RoundTripper
RoundTripper returns a round tripper capable of performing DANE/TLSA verification. Uses the given resolver for dns lookups.
func TLSASupported ¶
TLSASupported checks if there is a supported DANE usage from the given TLSA records. currently checks for usage EE(3).
Types ¶
type ClientResolver ¶
type ClientResolver struct {
// contains filtered or unexported fields
}
ClientResolver implements Resolver and caches queries.
func NewResolver ¶
func NewResolver(server string) (*ClientResolver, error)
NewResolver creates a new resolver the server can be specified using udp://, tcp://, tls:// or https://
func (*ClientResolver) LookupIP ¶
LookupIP looks up host using the specified resolver. It returns a slice of that host's IPv4 and IPv6 addresses.
func (*ClientResolver) LookupTLSA ¶
func (rs *ClientResolver) LookupTLSA(prefix string) ([]dns.TLSA, error)
LookupTLSA returns TLSA records for the given TLSA prefix.