-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support TLS Server/Client certificates read from a file, and refreshe… #149
Conversation
c9e9456
to
5f49aeb
Compare
9b7928e
to
a732c0e
Compare
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.
Looking slick, Joel!
pkg/util/tls_test.go
Outdated
@@ -207,6 +267,14 @@ func TestTLSConfigFromClientConfiguration(t *testing.T) { | |||
} | |||
|
|||
func TestTLSConfigFromServerConfiguration(t *testing.T) { | |||
tempDir := t.TempDir() | |||
exampleCertFile := tempDir + "/example-cert.pem" |
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.
filepath.Join() ?
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.
Whoops! It looks like we can also use filepath.Join() here.
Thanks Ed! Very helpful tips, I appreciate it. Changes are made! :) |
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.
One small change requested, and then we're good with merging this.
pkg/util/tls_test.go
Outdated
@@ -207,6 +267,14 @@ func TestTLSConfigFromClientConfiguration(t *testing.T) { | |||
} | |||
|
|||
func TestTLSConfigFromServerConfiguration(t *testing.T) { | |||
tempDir := t.TempDir() | |||
exampleCertFile := tempDir + "/example-cert.pem" |
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.
Whoops! It looks like we can also use filepath.Join() here.
…d on an interval. Incompatible Changes: This change moves the existing `{client,server}_certificate` and `{client,server}_private_key` into `{client,server}_key_pair_data.certificate` and `{client,server}_key_pair_data.private_key` This change adds an alternate strategy for specifying certificates/private keys by using `{client,server}_key_pair_files.certificate` and `{client,server}_key_pair_files.private_key` which should reference PEM files on disk. A refresh_interval must also be specified to dictate the interval at which the files should be read and used in place of the existing certificate/key if such files have been changed. In kubernetes for example, this allows a side-car to rotate certificate based on user's needs.
Ah! So sorry, fixed now :) |
…d on an interval.
Incompatible Changes:
This change moves the existing
{client,server}_certificate
and{client,server}_private_key
into{client,server}_key_pair.inline.certificate
and{client,server}_key_pair.inline.private_key
This change adds an alternate strategy for specifying certificates/private keys by using
{client,server}_key_pair.files.certificate_path
and{client,server}_key_pair.files.private_key_path
which should reference PEM files on disk. A refresh_interval must also be specified to dictate the interval at which the files should be read and used in place of the existing certificate/key if such files have been changed.In kubernetes for example, this allows a side-car to rotate certificate based on user's needs.