Skip to content

Commit

Permalink
fix: use proper key usage for apid client certificate
Browse files Browse the repository at this point in the history
This command is referenced from PKI recovery documentation.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
  • Loading branch information
smira committed Dec 19, 2022
1 parent 171aa94 commit a9643b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/talosctl/cmd/mgmt/gen/crt.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ var genCrtCmd = &cobra.Command{
return fmt.Errorf("error parsing CSR: %s", err)
}

signedCrt, err := x509.NewCertificateFromCSR(caCrt, caKey, ccsr, x509.NotAfter(time.Now().Add(time.Duration(genCrtCmdFlags.hours)*time.Hour)))
signedCrt, err := x509.NewCertificateFromCSR(caCrt, caKey, ccsr,
x509.NotAfter(time.Now().Add(time.Duration(genCrtCmdFlags.hours)*time.Hour)),
x509.KeyUsage(stdlibx509.KeyUsageDigitalSignature),
x509.ExtKeyUsage([]stdlibx509.ExtKeyUsage{stdlibx509.ExtKeyUsageClientAuth}),
)
if err != nil {
return fmt.Errorf("error signing certificate: %s", err)
}
Expand Down

0 comments on commit a9643b4

Please sign in to comment.