Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--days=0 show-expire errors #1247

Closed
cyqsimon opened this issue Oct 24, 2024 · 5 comments · Fixed by #1254
Closed

--days=0 show-expire errors #1247

cyqsimon opened this issue Oct 24, 2024 · 5 comments · Fixed by #1254
Assignees
Milestone

Comments

@cyqsimon
Copy link

I was trying to list the certificate that have already expired; instead it produced this error:

Error
-----
--days - Number expected: '0'

I suppose it's because --days=0 does not make sense in other contexts, but it does make sense in this one. Is there a workaround?

Version

EasyRSA version 3.1.6 (EL9)

@TinCanTech
Copy link
Collaborator

@cyqsimon In what context does this make sense ?

The command will show expired certificates, regardless of --days.

@cyqsimon
Copy link
Author

Well, without a --days arg, it prints certificates that are about to expire (which defaults to "will expire within 90 days"), as well as those that have already expired.

If you want to strictly only show those that have already expired, the natural thing to do is to specify --days=0, but it doesn't parse.

@TinCanTech
Copy link
Collaborator

@cyqsimon Here is a quick fix for you to try:

diff --git a/easyrsa3/easyrsa b/easyrsa3/easyrsa
index 7ee87fa..f2ddd7d 100755
--- a/easyrsa3/easyrsa
+++ b/easyrsa3/easyrsa
@@ -5582,6 +5582,7 @@ while :; do
        case "$opt" in
                --days)
                        number_only=1
+                       zero_allowed=1
                        # Set the appropriate date variable
                        # when called by command later
                        alias_days="$val"

@cyqsimon
Copy link
Author

Yep that fixes it. Thanks a lot for the swift response.

Will this change be included in tree?

@TinCanTech
Copy link
Collaborator

The patch only allows you to pass zero as a parameter to openssl x509 -checkend 0.

What fix are you expecting ?

@TinCanTech TinCanTech reopened this Oct 24, 2024
@TinCanTech TinCanTech linked a pull request Nov 10, 2024 that will close this issue
@TinCanTech TinCanTech added this to the v3.2.2 milestone Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants