-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: develop
Are you sure you want to change the base?
Conversation
return err | ||
} else if tlsConfig != nil { |
There was a problem hiding this comment.
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.
…jure-go-runtime into lfdo/refreshable-tls-config
|
||
return newTLSConfig(currentSecurity) | ||
security.SubscribeToSecurityConfig(func(currentSecurity SecurityConfig) { | ||
currentTLSConfig, err := newTLSConfig(currentSecurity) |
There was a problem hiding this comment.
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{}) { |
There was a problem hiding this comment.
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)
This should allow updating the TLS config whenever there's a change to security files such as certs and CAs.