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

go/common/identity: Don't forget to refresh TLS certificate #4289

Merged
merged 1 commit into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changelog/4289.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go/common/identity: Don't forget to refresh TLS certificate
2 changes: 1 addition & 1 deletion go/common/identity/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func doLoadOrGenerate(dataDir string, signerFactory signature.SignerFactory, sho

// First, check if we can load the TLS certificate from disk.
tlsCertPath, tlsKeyPath := TLSCertPaths(dataDir)
cert, err := tlsCert.Load(tlsCertPath, tlsKeyPath)
cert, err := tlsCert.LoadFromKey(tlsKeyPath, CommonName)
if err == nil {
// Load successful, ensure that we won't ever rotate the certificates.
dnr = true
Expand Down
2 changes: 1 addition & 1 deletion go/common/identity/identity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestLoadOrGenerate(t *testing.T) {
require.EqualValues(t, identity.P2PSigner, identity2.P2PSigner)
require.EqualValues(t, identity.ConsensusSigner, identity2.ConsensusSigner)
require.EqualValues(t, identity.GetTLSSigner(), identity2.GetTLSSigner())
require.EqualValues(t, identity.GetTLSCertificate(), identity2.GetTLSCertificate())
require.NotEqual(t, identity.GetTLSCertificate(), identity2.GetTLSCertificate())
require.EqualValues(t, identity.GetTLSPubKeys(), identity2.GetTLSPubKeys())
require.NotEqual(t, identity.TLSSentryClientCertificate, identity2.TLSSentryClientCertificate)
require.EqualValues(t, identity.TLSSentryClientCertificate.PrivateKey, identity2.TLSSentryClientCertificate.PrivateKey)
Expand Down