DialContext connects to the given network address and initiates a TLS handshake, returning the resulting TLS connection. The provided Context must be non-nil. If the context expires before the connection is complete, an error is returned. Once successfully connected, any expiration of the context w
(ctx context.Context, network, addr string)
| 214 | // |
| 215 | // The returned Conn, if any, will always be of type *Conn. |
| 216 | func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error) { |
| 217 | c, err := dial(ctx, d.netDialer(), network, addr, d.Config) |
| 218 | if err != nil { |
| 219 | // Don't return c (a typed nil) in an interface. |
| 220 | return nil, err |
| 221 | } |
| 222 | return c, nil |
| 223 | } |
| 224 | |
| 225 | // LoadX509KeyPair reads and parses a public/private key pair from a pair |
| 226 | // of files. The files must contain PEM encoded data. The certificate file |