From 7dfad16d6e733985ee264c8e190cc8c1b7560141 Mon Sep 17 00:00:00 2001 From: Chris Marslender Date: Thu, 12 Sep 2024 12:17:02 -0500 Subject: [PATCH] Ensure we assign the privateCAKey outside the if block --- pkg/tls/tls.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/tls/tls.go b/pkg/tls/tls.go index e1965a1..e03d4c1 100644 --- a/pkg/tls/tls.go +++ b/pkg/tls/tls.go @@ -77,7 +77,8 @@ func GenerateAllCerts(outDir string, privateCACert *x509.Certificate, privateCAK if privateCACert == nil && privateCAKey == nil { // If privateCACert and privateCAKey are both nil, we will generate a new one - privateCACertDER, privateCAKey, err := GenerateNewCA() + var privateCACertDER []byte + privateCACertDER, privateCAKey, err = GenerateNewCA() if err != nil { return fmt.Errorf("error creating private ca pair: %w", err) }