mirror of
https://github.com/kubernetes/client-go.git
synced 2025-12-25 22:22:28 +00:00
Remove invalid SAN certificate construction
Kubernetes-commit: 4983187b9a7b97b5932508d9c42979b928218cb8
This commit is contained in:
committed by
Kubernetes Publisher
parent
4765adee37
commit
7e6bf40aa6
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user