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

Method SetTLSFingerprintSpec

client.go:1291–1296  ·  view source on GitHub ↗

SetTLSFingerprintSpec set the tls fingerprint for tls handshake using a custom ClientHelloSpec, which allows fine-grained control over the TLS fingerprint (e.g. for JA3/JA4 customization). Uses utls (https://github.com/refraction-networking/utls) to perform the tls handshake. Note this is valid for

(clientHelloID *utls.ClientHelloSpec)

Source from the content-addressed store, hash-verified

1289// (https://github.com/refraction-networking/utls) to perform the tls handshake.
1290// Note this is valid for HTTP1 and HTTP2, not HTTP3.
1291func (c *Client) SetTLSFingerprintSpec(clientHelloID *utls.ClientHelloSpec) *Client {
1292 c.setTLSFingerprint(utls.HelloCustom, func(conn *uTLSConn) error {
1293 return conn.ApplyPreset(clientHelloID)
1294 })
1295 return c
1296}
1297
1298// SetTLSHandshake set the custom tls handshake function, only valid for HTTP1 and HTTP2, not HTTP3,
1299// it specifies an optional dial function for tls handshake, it works even if a proxy is set, can be

Callers

nothing calls this directly

Calls 1

setTLSFingerprintMethod · 0.95

Tested by

no test coverage detected