Skip to content

Commit a891089

Browse files
committed
fix: add CA subject to generated certificate
Self-signed certificates are missing Subject/Issuer info, which are not present in CA. This sometimes might be causing issues as it is invalid format. Signed-off-by: Mateusz Urbanek <[email protected]>
1 parent 35dd612 commit a891089

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmd/talosctl/pkg/mgmt/helpers/airgapped.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ import (
1313

1414
// GenerateSelfSignedCert generates self-signed certificate.
1515
func GenerateSelfSignedCert(sanIPs []net.IP, sanNames []string) ([]byte, []byte, []byte, error) {
16-
ca, err := x509.NewSelfSignedCertificateAuthority(x509.ECDSA(true))
16+
ca, err := x509.NewSelfSignedCertificateAuthority(
17+
x509.ECDSA(true),
18+
x509.Organization("talos.dev"),
19+
x509.CommonName("talos.dev Root CA"),
20+
)
1721
if err != nil {
1822
return nil, nil, nil, err
1923
}
2024

2125
serverIdentity, err := x509.NewKeyPair(ca,
22-
x509.Organization("test"),
26+
x509.Organization("talos.dev"),
2327
x509.CommonName("server"),
2428
x509.IPAddresses(sanIPs),
2529
x509.DNSNames(sanNames),

0 commit comments

Comments
 (0)