Closed gaukas closed 7 months ago
This behavior is not restricted to Read()
, but also multiple other functions where UConn
directly inherits from Conn
.
but basically if you explicitly call UConn.Handshake before UConn.Read you're good right?
but basically if you explicitly call UConn.Handshake before UConn.Read you're good right?
Correct. This issue is more about an inconsistent behavior that when someone switch from crypto/tls
to uTLS, where the former does not require an explicit call to Handshake, uTLS may use the default version of handshake if Handshake()
is not explicitly called.
This should be considered a high priority bug.
In
crypto/tls
, upon calling(*Conn).Read()
,(*Conn).Handshake()
will be called if TLS handshake is not yet performed.However,
UConn
in uTLS did not correctly inherit this behavior. By fully inheriting(*Conn).Read()
, it also calls(*Conn).Handshake()
instead of(*UConn).Handshake()
, where the latter is the function performing a uTLS handshake and the former one performs defaultcrypto/tls
handshake.