From 4b441b5a51fd6dd4f67bdc310739938f965512eb Mon Sep 17 00:00:00 2001 From: sinku Date: Thu, 6 Aug 2026 15:35:40 -0400 Subject: [PATCH] fix: panic when spec omits session ticket extension --- u_conn.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/u_conn.go b/u_conn.go index d84567690a..c763f753a5 100644 --- a/u_conn.go +++ b/u_conn.go @@ -180,6 +180,14 @@ func (uconn *UConn) uLoadSession() error { return err } if session.version == VersionTLS12 { + // [uTLS] Without a session ticket extension there is nowhere to + // put the TLS 1.2 ticket. initSessionTicketExt below would skip + // initialization and leave the controller in NoSession, and the + // following setSessionTicketToUConn would then fail its state + // assertion. Skip resumption instead. + if uconn.sessionController.sessionTicketExt == nil { + return nil + } // We use the session ticket extension for tls 1.2 session resumption uconn.sessionController.initSessionTicketExt(session, hello.sessionTicket) uconn.sessionController.setSessionTicketToUConn()