refraction-networking / utls

Fork of the Go standard TLS library, providing low-level access to the ClientHello for mimicry purposes.
BSD 3-Clause "New" or "Revised" License
1.71k stars 247 forks source link

fix: generate ClientHelloSpec only once #306

Closed adotkhan closed 4 months ago

adotkhan commented 4 months ago

This fixes an issue introduced in https://github.com/refraction-networking/utls/pull/301 where calling BuildHanshakeStateWithoutSession with a random profile, generates a new CilentHelloSpec on each call.

This PR assume that UConn.ClientHelloID is read-only and that it's value should not be modified, which is my understanding of uTLS currently operates. If this assumption is false, another workaround needs to be found.

A review of this is very much appreciated.

adotkhan commented 4 months ago

Thank you for the review, change applied.