fix(cmd/cert): only create root cert/key with flag
@@ -45,8 +45,12 @@ func main() {
certManager, rootCert := getCertManager()
+ if *caPEMFileOut != "" {
writeFile(*caPEMFileOut, rootCert.GetCertificateChain())
+ }
+ if *caKeyPEMFileOut != "" {
writeFile(*caKeyPEMFileOut, rootCert.GetPrivateKey())
+ }
cert, err := certManager.IssueCertificate(certificate.CommonName(*host))
if err != nil {
