MCPcopy Create free account
hub / github.com/imroc/req / SetTLSHandshake

Method SetTLSHandshake

client.go:1301–1304  ·  view source on GitHub ↗

SetTLSHandshake set the custom tls handshake function, only valid for HTTP1 and HTTP2, not HTTP3, it specifies an optional dial function for tls handshake, it works even if a proxy is set, can be used to customize the tls fingerprint.

(fn func(ctx context.Context, addr string, plainConn net.Conn) (conn net.Conn, tlsState *tls.ConnectionState, err error))

Source from the content-addressed store, hash-verified

1299// it specifies an optional dial function for tls handshake, it works even if a proxy is set, can be
1300// used to customize the tls fingerprint.
1301func (c *Client) SetTLSHandshake(fn func(ctx context.Context, addr string, plainConn net.Conn) (conn net.Conn, tlsState *tls.ConnectionState, err error)) *Client {
1302 c.Transport.SetTLSHandshake(fn)
1303 return c
1304}
1305
1306// SetTLSHandshakeTimeout set the TLS handshake timeout.
1307func (c *Client) SetTLSHandshakeTimeout(timeout time.Duration) *Client {

Callers 1

setTLSFingerprintMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected