Skip to content

Remove SessionTicketsDisabled code after Go 1.21 update#30220

Closed
jakule wants to merge 2 commits intomasterfrom
jakule/disable-session-cache
Closed

Remove SessionTicketsDisabled code after Go 1.21 update#30220
jakule wants to merge 2 commits intomasterfrom
jakule/disable-session-cache

Conversation

@jakule
Copy link
Copy Markdown
Contributor

@jakule jakule commented Aug 9, 2023

Removed lines of code in lib/auth/helpers.go and lib/utils/tls.go that disabled session tickets and managed client session cache. The behavior has changed in Go 1.21, and after the upgrade, the cache may hold old certificates that were invalidated.

This change may have a performance impact and should not be backported before full performance testing that we do during the test plan.

Related #30201

Removed lines of code in lib/auth/helpers.go and lib/utils/tls.go that disabled session tickets and managed client session cache. The behavior has changed in Go 1.21, and after the upgrade, the cache may hold old certificates that were invalidated.

This change may have a performance impact and should not be backported before full performance testing that we do during the test plan.
@jakule jakule requested review from codingllama and zmb3 August 9, 2023 15:12
@github-actions github-actions Bot requested a review from ibeckermayer August 9, 2023 15:12
@zmb3 zmb3 requested a review from rosstimothy August 9, 2023 15:20
Comment thread lib/utils/tls.go Outdated
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
@jakule jakule requested a review from zmb3 August 9, 2023 15:23
Copy link
Copy Markdown
Contributor

@codingllama codingllama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious to see what impact this may have.

LGTM as long as others are happy to have it land.

Copy link
Copy Markdown
Contributor

@rosstimothy rosstimothy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to merge this and see what the impacts are, but, I think we first need to define our success criteria. Will the consequences of this change be evident from our existing cases in the Test Plan? Should we add a scenario that explicitly covers this and test it on both v13 latest and v14? Without any historical numbers how will we know if we are better or worse?

Comment thread lib/utils/tls.go
Comment on lines -45 to -46
config.SessionTicketsDisabled = false
config.ClientSessionCache = tls.NewLRUClientSessionCache(DefaultLRUCapacity)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the default for SessionTicketsDisabled is already false. This change will disable client session cache, but still support session tickets for anything using this config as a server. If the intent here is to disable session tickets altogether then we should put config.SessionTicketsDisabled = true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we decide to keep session tickets enabled for servers, then I think we should also keep the client session caching and just fix the tests to not clone the cache. That can be done in the test code by calling SetupTLSConfig after we clone the client, or by setting it to nil or something

@zmb3
Copy link
Copy Markdown
Collaborator

zmb3 commented Nov 14, 2023

@jakule @rosstimothy let's make a decision on this one so that it doesn't rot.

Close or merge?

@jakule
Copy link
Copy Markdown
Contributor Author

jakule commented Nov 15, 2023

@jakule @rosstimothy let's make a decision on this one so that it doesn't rot.

Close or merge?

+1 for closing

@jakule jakule closed this Nov 16, 2023
@rosstimothy rosstimothy deleted the jakule/disable-session-cache branch May 28, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants