MCPcopy
hub / github.com/XTLS/REALITY / clientSessionCacheKey

Method clientSessionCacheKey

handshake_client.go:1289–1297  ·  view source on GitHub ↗

clientSessionCacheKey returns a key used to cache sessionTickets that could be used to resume previously negotiated TLS sessions with a server.

()

Source from the content-addressed store, hash-verified

1287// clientSessionCacheKey returns a key used to cache sessionTickets that could
1288// be used to resume previously negotiated TLS sessions with a server.
1289func (c *Conn) clientSessionCacheKey() string {
1290 if len(c.config.ServerName) > 0 {
1291 return c.config.ServerName
1292 }
1293 if c.conn != nil {
1294 return c.conn.RemoteAddr().String()
1295 }
1296 return ""
1297}
1298
1299// hostnameInSNI converts name into an appropriate hostname for SNI.
1300// Literal IP addresses and absolute FQDNs are not permitted as SNI values.

Callers 5

clientHandshakeMethod · 0.95
loadSessionMethod · 0.95
saveSessionTicketMethod · 0.80
StoreSessionMethod · 0.80

Calls 2

RemoteAddrMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected