Skip to content

Commit

Permalink
fix: skip saving if nil cache (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaukas committed Aug 11, 2023
1 parent a998534 commit d74571a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion handshake_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit d74571a

Please sign in to comment.