From 811a3bddfda2ee3dbfa0f9b46d534b46d708be80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Cluseau?= Date: Fri, 27 Jan 2023 06:42:39 +0100 Subject: [PATCH] renew: don't use Renew, just create a new cert --- cmd/dkl-local-server/secrets.go | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/cmd/dkl-local-server/secrets.go b/cmd/dkl-local-server/secrets.go index fb1987e..fb0836c 100644 --- a/cmd/dkl-local-server/secrets.go +++ b/cmd/dkl-local-server/secrets.go @@ -226,19 +226,7 @@ func (sd *SecretData) RenewCACert(cluster, name string) (err error) { return } - var newCert []byte - - cert, err := helpers.ParseCertificatePEM(ca.Cert) - if err == nil { - newCert, err = initca.RenewFromSigner(cert, signer) - } - - if err != nil { - // failed to load or renew, create a new cert from the existing key - req := newCACertReq() - newCert, _, err = initca.NewFromSigner(req, signer) - } - + newCert, _, err := initca.NewFromSigner(newCACertReq(), signer) if err != nil { return }