From d74571af51643b3563e998ed624702970494f757 Mon Sep 17 00:00:00 2001 From: Gaukas Wang Date: Thu, 10 Aug 2023 23:12:54 -0600 Subject: [PATCH] fix: skip saving if nil cache (#219) --- handshake_client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/handshake_client.go b/handshake_client.go index eae1a42..088baa5 100644 --- a/handshake_client.go +++ b/handshake_client.go @@ -941,7 +941,11 @@ func (hs *clientHandshakeState) saveSessionTicket() error { session.secret = hs.masterSecret cs := &ClientSessionState{ticket: hs.ticket, session: session} - c.config.ClientSessionCache.Put(cacheKey, cs) + // [UTLS BEGIN] + if c.config.ClientSessionCache != nil { // skip saving session if cache is nil + c.config.ClientSessionCache.Put(cacheKey, cs) + } + // [UTLS END] return nil }