Skip to content

v1.5.0-beta.2 the pre_shared_key

Pre-release
Pre-release
Compare
Choose a tag to compare
@gaukas gaukas released this 16 Aug 00:28
· 265 commits to master since this release
v1.5.0-beta.2

We are finally supporting pre_shared_key! I mean, with REAL support.

To use it, you must provide a type interfacing ClientSessionCache:

// 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
// SessionID-based resumption. In TLS 1.3 they were merged into PSK modes, which
// are supported via this interface.
type ClientSessionCache interface {
	// Get searches for a ClientSessionState associated with the given key.
	// On return, ok is true if one was found.
	Get(sessionKey string) (session *ClientSessionState, ok bool)

	// Put adds the ClientSessionState to the cache with the given key. It might
	// get called multiple times in a connection if a TLS 1.3 server provides
	// more than one session ticket. If called with a nil *ClientSessionState,
	// it should remove the cache entry.
	Put(sessionKey string, cs *ClientSessionState)
}

Where the sessionKey is the ServerName (or IP Address if no ServerName).

This update could possibly break TLS 1.2 session resumption support from older versions, so please report any bugs you encountered.

This update includes a breaking change of PreShareKeyExtension: it is now an interface.

What's Changed

Full Changelog: v1.5.0-beta.1...v1.5.0-beta.2