Fix shadowtls in go versiojns below 1.20

This commit is contained in:
世界 2023-02-19 12:01:46 +08:00
parent 3c5bc842ed
commit f516026540
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -145,6 +145,7 @@ func (c *Conn) makeClientHello() (*clientHelloMsg, ecdheParameters, error) {
if err := config.SessionIDGenerator(hello.marshal(), hello.sessionId); err != nil { if err := config.SessionIDGenerator(hello.marshal(), hello.sessionId); err != nil {
return nil, nil, errors.New("tls: generate session id failed: " + err.Error()) return nil, nil, errors.New("tls: generate session id failed: " + err.Error())
} }
hello.raw = nil
} else { } else {
if _, err := io.ReadFull(config.rand(), hello.sessionId); err != nil { if _, err := io.ReadFull(config.rand(), hello.sessionId); err != nil {
return nil, nil, errors.New("tls: short read from Rand: " + err.Error()) return nil, nil, errors.New("tls: short read from Rand: " + err.Error())