From 412af925380524991b41a56a50580702d981e011 Mon Sep 17 00:00:00 2001 From: Simon Marsh Date: Tue, 26 Jul 2022 11:40:12 +0100 Subject: [PATCH] allow zero sized cert for bootstrapping --- mini-vault/tls.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mini-vault/tls.go b/mini-vault/tls.go index 9649b9c..c0f5f1b 100644 --- a/mini-vault/tls.go +++ b/mini-vault/tls.go @@ -85,7 +85,7 @@ func CmdTLSRenew(cmd *cobra.Command, args []string) { } // load existing cert if it existed - if _, err := os.Stat(TLSCertPEM); err == nil { + if info, err := os.Stat(TLSCertPEM); err == nil && info.Size() > 0 { fmt.Printf("Loading existing certificate: %s\n", TLSCertPEM) data, err := os.ReadFile(TLSCertPEM)