Skip to content

Commit

Permalink
[v17] Disable server-side TLS session tickets (#48166)
Browse files Browse the repository at this point in the history
* Disable server-side TLS session tickets

* Fix CloneClient helper
  • Loading branch information
espadolini authored Oct 31, 2024
1 parent e26ce74 commit 32e1761
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/auth/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,8 @@ func (t *TestTLSServer) CloneClient(tt *testing.T, clt *authclient.Client) *auth
// shared between all clients that use the same TLS config.
// Reusing the cache will skip the TLS handshake and may introduce a weird
// behavior in tests.
if !tlsConfig.SessionTicketsDisabled {
if tlsConfig.ClientSessionCache != nil {
tlsConfig = tlsConfig.Clone()
tlsConfig.ClientSessionCache = tls.NewLRUClientSessionCache(utils.DefaultLRUCapacity)
}

Expand Down
5 changes: 5 additions & 0 deletions lib/utils/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ func SetupTLSConfig(config *tls.Config, cipherSuites []uint16) {
config.CipherSuites = cipherSuites
}

// pre-v17 Teleport uses a client ticket cache, which doesn't play well with
// verification (both client- and server-side) when using dynamic
// credentials and CAs (in v17+ Teleport)
config.SessionTicketsDisabled = true

config.MinVersion = tls.VersionTLS12
}

Expand Down

0 comments on commit 32e1761

Please sign in to comment.