v1.3.2 bug fixes, robustness, and new (beta) ClientHelloSpecs
What's Changed
- fixes #127 by @fqrious in #175
- Implement ClientHelloSpec JSON Unmarshaler by @gaukas in #176
- fix: PSK extension w/o session cache crashing by @gaukas in #177
- fix: connection state locked never called by @blakebyrnes in #178
- fix: don't shuf psk by @gaukas in #180
Note
Added HelloChrome_100_PSK
and HelloChrome_112_PSK_Shuf
, which includes PreSharedKey
automatically instead of Padding
as the last TLS extensions.
To use them correctly, you are required to use (*UConn).ApplyPreset()
:
conn := utls.UClient(plainConn, utlsConfig, utls.HelloCustom)
preset, err := utls.UTLSIdToSpec(utls.HelloChrome_112_PSK_Shuf) // correct
if err != nil {
return nil, err
}
if pskExt, ok := preset.Extensions[len(preset.Extensions)-1].(*utls.FakePreSharedKeyExtension); ok {
pskExt.PskIdentities = []utls.PskIdentity{ // must set identity
{
Label: []byte("blahblahblah"), // change this
ObfuscatedTicketAge: 0, // change this
},
}
// each fake binder is 32 bytes of zeros
pskExt.PskBinders = [][]byte{ // must set psk binders
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // change this
},
} // byte slices
}
conn.ApplyPreset(&preset) // make sure to apply preset to the connection
Instead of
conn := utls.UClient(plainConn, utlsConfig, utls.HelloChrome_112_PSK_Shuf) // incorrect! PSK extension will use empty payload!
New Contributors
- @fqrious made their first contribution in #175
- @blakebyrnes made their first contribution in #178
Full Changelog: v1.3.1...v1.3.2