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.81k stars 445 forks source link

[Bug]: Context is not honored #2043

Closed LaudixGit closed 1 month ago

LaudixGit commented 1 month ago

Steps to Reproduce

Install: winget install Smallstep.step create cert: step ca init --deployment-type standalone --name "cntx01" --dns "localhost" --address "127.0.0.1:443" --provisioner "MyProv" --context "cntx01"

Your Environment

Expected Behavior

new files should be created in a subfolder $env:USERPROFILE/.step/authorities/cntx01/certs/root_ca.crt

Actual Behavior

files are created at top folder $env:USERPROFILE/.step/certs/root_ca.crt

Creating a new root cert results in overwritten the existing. image

Additional Context

I am setting up a new laptop and this error occurs. Issue occurs at a command prompt (cmd) and in a PowerShell terminal

step runs as expected on my old laptop (windows 10, step version 27.4)

Documentation still states there should be an "authorities" folder

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).

LaudixGit commented 1 month ago

Using step v 27.4 on my new windows 11 laptop is successful

"step_windows_0.27.4_amd64\step_0.27.4\bin\step.exe" ca init --deployment-type standalone --name "cntx03" --dns "localhost" --address "127.0.0.1:443" --provisioner "MyProv" --context "cntx03"

hslatman commented 1 month ago

Hey @LaudixGit, thank you for reporting the issue. I found out what's going on. The CLI relies on our certificates repo, which is still using our old version of cli-utils. This results in a state mismatch between the two, resulting in the context being ignored. I've opened https://github.com/smallstep/certificates/pull/2046 to fix it for certificates, after which I can fix it here.

hslatman commented 1 month ago

https://github.com/smallstep/cli/pull/1301 fixes the issue.