From 238ac7a40b763bb54d594f1d5bf17f0715aa7894 Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Fri, 26 Dec 2025 22:51:27 -0500 Subject: [PATCH] crypto/tls: check if quic conn can send session ticket On SendSessionTicket, returns nil if SessionTicketsDisabled is disabled in config. Fixes #62032 Change-Id: Id0c89e2e6fb0805bbf108bb0cafdabdfbaf3897f Reviewed-on: https://go-review.googlesource.com/c/go/+/528755 Reviewed-by: Roland Shoemaker Reviewed-by: Damien Neil LUCI-TryBot-Result: Go LUCI Reviewed-by: Mark Freeman --- quic.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/quic.go b/quic.go index 83637e1..74c96dd 100644 --- a/quic.go +++ b/quic.go @@ -303,6 +303,9 @@ type QUICSessionTicketOptions struct { // Currently, it can only be called once. func (q *QUICConn) SendSessionTicket(opts QUICSessionTicketOptions) error { c := q.conn + if c.config.SessionTicketsDisabled { + return nil + } if !c.isHandshakeComplete.Load() { return quicError(errors.New("tls: SendSessionTicket called before handshake completed")) }