Documentation ¶
Overview ¶
package tlsdialer contains a customized version of crypto/tls.Dial that allows control over whether or not to send the ServerName extension in the client handshake.
Index ¶
- func Dial(network, addr string, sendServerName bool, config *tls.Config) (*tls.Conn, error)
- func DialWithDialer(dialer *net.Dialer, network, addr string, sendServerName bool, ...) (*tls.Conn, error)
- func OverrideDial(override func(network, addr string, timeout time.Duration) (net.Conn, error))
- func OverrideResolve(override func(addr string) (*net.TCPAddr, error))
- type ConnWithTimings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dial ¶
Like crypto/tls.Dial, but with the ability to control whether or not to send the ServerName extension in client handshakes through the sendServerName flag.
Note - if sendServerName is false, the VerifiedChains field on the connection's ConnectionState will never get populated. Use DialForTimings to get back a data structure that includes the verified chains.
func DialWithDialer ¶
func DialWithDialer(dialer *net.Dialer, network, addr string, sendServerName bool, config *tls.Config) (*tls.Conn, error)
Like crypto/tls.DialWithDialer, but with the ability to control whether or not to send the ServerName extension in client handshakes through the sendServerName flag.
Note - if sendServerName is false, the VerifiedChains field on the connection's ConnectionState will never get populated. Use DialForTimings to get back a data structure that includes the verified chains.
func OverrideDial ¶
OverrideDial allows specifying a function that will be used to dial in lieu of a net.Dialer.
Types ¶
type ConnWithTimings ¶
type ConnWithTimings struct { // Conn: the conn resulting from dialing Conn *tls.Conn // ResolutionTime: the amount of time it took to resolve the address ResolutionTime time.Duration // ConnectTime: the amount of time that it took to connect the socket ConnectTime time.Duration // HandshakeTime: the amount of time that it took to complete the TLS // handshake HandshakeTime time.Duration // ResolvedAddr: the address to which our dns lookup resolved ResolvedAddr *net.TCPAddr // VerifiedChains: like tls.ConnectionState.VerifiedChains VerifiedChains [][]*x509.Certificate }
A tls.Conn along with timings for key steps in establishing that Conn
func DialForTimings ¶
func DialForTimings(dialer *net.Dialer, network, addr string, sendServerName bool, config *tls.Config) (*ConnWithTimings, error)
Like DialWithDialer but returns a data structure including timings and the verified chains.