Actually use a cache if tlsDisableSessionTickets is not set

This commit is contained in:
Frank Denis 2018-04-10 00:36:55 +02:00
parent 8bebb50d49
commit e3ad6b1c0e
1 changed files with 3 additions and 0 deletions

View File

@ -101,6 +101,9 @@ func (xTransport *XTransport) rebuildTransport() {
tlsClientConfig := tls.Config{
SessionTicketsDisabled: xTransport.tlsDisableSessionTickets,
}
if !xTransport.tlsDisableSessionTickets {
tlsClientConfig.ClientSessionCache = tls.NewLRUClientSessionCache(10)
}
if xTransport.tlsCipherSuite != nil {
tlsClientConfig.PreferServerCipherSuites = false
tlsClientConfig.CipherSuites = xTransport.tlsCipherSuite