MCPcopy Index your code
hub / github.com/XTLS/Go / ClientSessionCache

Interface ClientSessionCache

common.go:353–363  ·  view source on GitHub ↗

ClientSessionCache is a cache of ClientSessionState objects that can be used by a client to resume a TLS session with a given server. ClientSessionCache implementations should expect to be called concurrently from different goroutines. Up to TLS 1.2, only ticket-based resumption is supported, not Se

Source from the content-addressed store, hash-verified

351// SessionID-based resumption. In TLS 1.3 they were merged into PSK modes, which
352// are supported via this interface.
353type ClientSessionCache interface {
354 // Get searches for a ClientSessionState associated with the given key.
355 // On return, ok is true if one was found.
356 Get(sessionKey string) (session *ClientSessionState, ok bool)
357
358 // Put adds the ClientSessionState to the cache with the given key. It might
359 // get called multiple times in a connection if a TLS 1.3 server provides
360 // more than one session ticket. If called with a nil *ClientSessionState,
361 // it should remove the cache entry.
362 Put(sessionKey string, cs *ClientSessionState)
363}
364
365//go:generate stringer -type=SignatureScheme,CurveID,ClientAuthType -output=common_string.go
366

Callers 6

writeRecordLockedMethod · 0.65
loadSessionMethod · 0.65
writeRecordLockedMethod · 0.65
clientHandshakeMethod · 0.65
loadSessionMethod · 0.65

Implementers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…