smallstep / certificates

🛡️ A private certificate authority (X.509 & SSH) & ACME server for secure automated certificate management, so you can use TLS everywhere & SSO for SSH.
https://smallstep.com/certificates
Apache License 2.0
6.5k stars 423 forks source link

[Bug]: step ca init ignores --context flag when using --pki #1710

Open larsks opened 6 months ago

larsks commented 6 months ago

Steps to Reproduce

With a step context already set:

$ step context list
▶ vault-test

Attempt to initialize a ca in a new context with the --pki flag:

$ step ca init  --pki --deployment-type standalone --name='test ca' \
  --password-file <(echo secret) --context test-ca

This command attempts to overwrite the files in the previously selected context, rather than using the context specified in the --context argument:

Generating root certificate... done!
Generating intermediate certificate... done!
✗ Would you like to overwrite /home/larsks/.step/authorities/vault-test/certs/root_ca.crt [y/n]: █

Your Environment

Expected Behavior

I expected step ca to generate files in the specified context.

Actual Behavior

It attempted to overwrite files in the current context instead.

Additional Context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).