mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-07-28 23:08:59 +02:00
perf(tls): enable session resumption on the stdlib transports
This commit is contained in:
@@ -74,9 +74,16 @@ func supplementalRootCAs() *x509.CertPool {
|
||||
return supplementalRootCAsPool
|
||||
}
|
||||
|
||||
// stdTLSSessionCache is shared by every stdlib transport so TLS session
|
||||
// tickets enable resumption (fewer handshake round-trips) after idle-pool
|
||||
// evictions and network switches. Package-level so toggling compatibility
|
||||
// options does not drop accumulated sessions.
|
||||
var stdTLSSessionCache = tls.NewLRUClientSessionCache(64)
|
||||
|
||||
func newTLSCompatibilityConfig(insecureTLS bool) *tls.Config {
|
||||
return &tls.Config{
|
||||
RootCAs: supplementalRootCAs(),
|
||||
InsecureSkipVerify: insecureTLS,
|
||||
ClientSessionCache: stdTLSSessionCache,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user