[Bug]: notBefore and notAfter values in template files are ignored
Maintainers usually reply within 1 day
@hslatman is already working on this.
Since Nov 11, 2025.
Assessment
This issue has not been assessed yet.
Description
Steps to Reproduce
I was playing around with template files and noticed that the notBefore and notAfter values in template files are ignored by the step-cli.
You can easily reproduce it when you use the fields notBefore and/or notAfter in a template file and create a certificate. You can see an example in the Actual behavior section.
You can use this for testing:
{
"notBefore": "2020-01-01T00:00:00Z",
"notAfter": "2030-01-01T00:00:00Z"
}
Your Environment
- OS - Fedora 42
stepCLI Version - CLI/0.28.7 (linux/amd64)
Expected Behavior
When specifing the notBefore and/or notAfter fields I would expect that the dates will be carried over to the actual certificate. The fields are visible in the certificate.go.
Actual Behavior
When specifing a wrong value you can see from the error that it actually reads the value:
Additional Context
My use-case for this would be to create something like standalone cert-profiles that are fully defined as code and don't need the CLI parameters. Then you can just specify the parts that change like the Subject and SAN and then just have to add the template
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).
- Dominant language
- Go
- Stars
- 4.3k
- Forks
- 320
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from smallstep/cli
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
enhancement needs triage
Difficulty 4/5 3-5 days Newbie friendliness 32/100
Maintainers usually reply within 1 day
-
enhancement needs triage
Difficulty 3/5 1-2 days Newbie friendliness 57/100
smallstep/cli#1713 · 1 reaction ·
Maintainers usually reply within 1 day
-
enhancement needs triage
Difficulty 4/5 3-5 days Newbie friendliness 35/100
smallstep/cli#1710 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
bug(terraform): a `kubernetes_manifest` the scan can't fully read is dropped and nothing says soOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OneBusAway/watchdog#455 ·
Maintainers usually reply within 1 day
-
help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rootsiemen/loophole#97 ·
Maintainers usually reply within 1 day
-
bug needs triage
Difficulty 1/5 Under an hour Newbie friendliness 84/100
smallstep/certificates#2863 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
SocialGouv/iterion#3889 ·
Maintainers usually reply within 1 day