diff --git a/cmd/identity/main.go b/cmd/identity/main.go index 15b86a84c..50a335289 100644 --- a/cmd/identity/main.go +++ b/cmd/identity/main.go @@ -105,11 +105,6 @@ func cmdNewService(cmd *cobra.Command, args []string) error { return errs.New("CA certificate and/or key already exits, NOT overwriting!") } - ca, caerr := caConfig.Create(process.Ctx(cmd), os.Stdout) - if caerr != nil { - return caerr - } - identConfig := identity.SetupConfig{ CertPath: identCertPath, KeyPath: identKeyPath, @@ -119,6 +114,11 @@ func cmdNewService(cmd *cobra.Command, args []string) error { return errs.New("Identity certificate and/or key already exits, NOT overwriting!") } + ca, caerr := caConfig.Create(process.Ctx(cmd), os.Stdout) + if caerr != nil { + return caerr + } + _, iderr := identConfig.Create(ca) if iderr != nil { return iderr