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

feat: support PSK after receiving HelloRetryRequest (HRR) #305

Open gaukas opened 4 months ago

gaukas commented 4 months ago

Currently there is no proper support for PSK if server sends a Hello Retry Request asking uTLS to switch to a different Key Share that is supported but not sent by default:

https://github.com/refraction-networking/utls/blob/841ef93712800db68a8789b28e70af2b4da1960e/handshake_client_tls13.go#L413-L416

This pull request adds support to handle PSK after seeing HRR.

gaukas commented 4 months ago

To those who have contributed to uTLS recently regarding PSK-related topics, I would appreciate it if you'd like to share your thoughts on my change included in this PR.

cc: @adotkhan, @sleeyax, @VeNoMouS, @3andne

This is just an unordered, incomplete list of uTLS contributors on PSK. If you are not mentioned but would share your thoughts, please feel free to do so!

VeNoMouS commented 4 months ago

Rgr Rgr, will try find some time this weekend to investigate and test