Remove invalid SAN certificate construction

Kubernetes-commit: 9bd285d24dee6a874dd915b49e4d20179bb69092
This commit is contained in:
Jordan Liggitt
2025-10-09 16:27:05 -04:00
committed by Kubernetes Publisher
parent 8eaec8fb35
commit b134ce0076

View File

@@ -75,13 +75,15 @@ func NewSelfSignedCACert(cfg Config, key crypto.Signer) (*x509.Certificate, erro
CommonName: cfg.CommonName,
Organization: cfg.Organization,
},
DNSNames: []string{cfg.CommonName},
NotBefore: notBefore,
NotAfter: now.Add(duration365d * 10).UTC(),
KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign,
BasicConstraintsValid: true,
IsCA: true,
}
if len(cfg.CommonName) > 0 {
tmpl.DNSNames = []string{cfg.CommonName}
}
certDERBytes, err := x509.CreateCertificate(cryptorand.Reader, &tmpl, &tmpl, key.Public(), key)
if err != nil {