@@ -311,6 +311,7 @@ func (c *Conn) HandshakeContext(ctx context.Context) error { //nolint:cyclop
311311 c .closeLock .Unlock ()
312312
313313 if c .isVersion13Enabled () {
314+ c .state .version = protocol .Version1_3
314315 var initialFlight flightVal
315316 if c .state .isClient {
316317 initialFlight = flightVal (flight13_1 )
@@ -1176,7 +1177,7 @@ func (c *Conn) recvHandshake() <-chan recvHandshakeState {
11761177
11771178func (c * Conn ) notify (ctx context.Context , level alert.Level , desc alert.Description ) error {
11781179 if level == alert .Fatal && len (c .state .SessionID ) > 0 { //nolint:nestif
1179- if c .isVersion13Enabled () {
1180+ if c .state . version == protocol . Version1_3 {
11801181 // With compatibility mode for 1.3, CH uses a non-empty session_id
11811182 // https://datatracker.ietf.org/doc/html/rfc8446#appendix-D.4
11821183 if ss := c .fsm .(* handshakeFSM13 ).cfg .sessionStore ; ss != nil { //nolint:forcetypeassert
@@ -1231,7 +1232,7 @@ func (c *Conn) handshake(
12311232 initialState handshakeState ,
12321233) error {
12331234 done := make (chan struct {})
1234- if c .isVersion13Enabled () {
1235+ if c .state . version == protocol . Version1_3 {
12351236 c .fsm = & handshakeFSM13 {
12361237 currentFlight : flightVal13 (initialFlight ),
12371238 state : & c .state ,
@@ -1458,7 +1459,7 @@ func (c *Conn) sessionKey() []byte {
14581459 // As ServerName can be like 0.example.com, it's better to add
14591460 // delimiter character which is not allowed to be in
14601461 // neither address or domain name.
1461- if c .isVersion13Enabled () {
1462+ if c .state . version == protocol . Version1_3 {
14621463 return []byte (c .rAddr .String () + "_" + c .fsm .(* handshakeFSM13 ).cfg .serverName ) //nolint:forcetypeassert
14631464 }
14641465
0 commit comments