Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement: Make TLSConfig refreshable #545

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

splucs
Copy link

@splucs splucs commented Oct 6, 2023

This should allow updating the TLS config whenever there's a change to security files such as certs and CAs.

@splucs splucs requested a review from bmoylan October 6, 2023 02:10
return err
} else if tlsConfig != nil {
Copy link
Author

Choose a reason for hiding this comment

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

Because of the subscription to the security config, this should always return a non-nil refreshable.


return newTLSConfig(currentSecurity)
security.SubscribeToSecurityConfig(func(currentSecurity SecurityConfig) {
currentTLSConfig, err := newTLSConfig(currentSecurity)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we care that this does not handle changing file contents, only file paths?

})

if tlsConfig != nil {
tlsConfig.Subscribe(func(tlsConfI interface{}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The general concern I had with the original implementation was this subscription because *tls.Config is not compatible with reflect.DeepEqual (it contains closures in struct fields) so other changes could cause us to rebuild our transport (and lose shared connections)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants