-
Notifications
You must be signed in to change notification settings - Fork 11
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
[Bug fix] tls reload: enable for client cert #42
Conversation
- remove unused fields in TLSConfig struct
82762bf
to
b7ea1f6
Compare
@thrawn01 , do you mind taking a look at this PR? |
@@ -109,12 +109,6 @@ type TLSConfig struct { | |||
// (Optional) The client auth CA Certificate in PEM format. Used if ClientAuthCaFile is unset. | |||
ClientAuthCaPEM *bytes.Buffer | |||
|
|||
// (Optional) The client auth private key in PEM format. Used if ClientAuthKeyFile is unset. | |||
ClientAuthKeyPEM *bytes.Buffer |
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 fields are not used throughout the code
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.
Sorry this took so long, thank you for mentioning me on this PR. I'll check notifications for this repo, some how I didn't see this PR until now.
@thrawn01 , thanks for merging. I guess we need a new minor release for the fix. |
This PR fixes a bug in reloading the tls certificate for the gRPC client. Gubernator instance reports messages
remote error: tls: expired certificate
after running for a couple of days.What caused the problem
in the current implementation, the client certificate of the key reload refers to a slice of
tls.Certificate
struct. During reload, there could be a chance the certificate is not loaded correctly, leading to the tls expiration error.How the PR fixes the issue
We use the
tls.GetClientCertificates
callback function to load the certificate for gRPC client to avoid any race condition. Additional improvements are that hot-reload of client cert is supported as well in this PR.Test
We deployed an image with the fix in 3-node cluster and let it run for 5 days with tls
ttl=5m
. There has been no error of tls expiration.