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

gem help cert does not show -d/--days #1768

Closed
djberg96 opened this issue Oct 31, 2016 · 6 comments
Closed

gem help cert does not show -d/--days #1768

djberg96 opened this issue Oct 31, 2016 · 6 comments
Assignees

Comments

@djberg96
Copy link
Contributor

gem -v => 2.6.8

The option to add -d/--days to gem cert was merged: #1719

But when I run gem help cert I see no reference to the new option. It does actually work in practice, though.

@bronzdoc
Copy link
Member

@djberg96 this feature is not in 2.6.8 but will be in 2.7

@bronzdoc
Copy link
Member

said that... idk how are you using that flag in 2.6.8 🤔

@djberg96
Copy link
Contributor Author

djberg96 commented Nov 1, 2016

@bronzdoc Didn't complain when I used the options:

dberger:~ >gem -v
2.6.8

dberger:~ >gem cert -b djberg96@xxx.com -d 1000
Passphrase for your Private Key:  

Please repeat the passphrase for your Private Key:  

Certificate: /Users/dberger/gem-public_cert.pem
Private Key: /Users/dberger/gem-private_key.pem
Don't forget to move the key file to somewhere private!

@bronzdoc
Copy link
Member

bronzdoc commented Nov 1, 2016

Yeah it's weird, I just tested it, also I tested it passing the flags to rubygems 2.6.0 and still accepts the flags without crashing. This is something that has been there for a long time probably even before 2.6.0, so this seems to work in the current version but the functionality isn't there...

if you do:

pem = File.read("./gem-public_cert.pem")
cert = OpenSSL::X509::Certificate.new(pem)

and then inspect cert you will see not_before and not_after are a year apart still, even if you did something like gem cert -b djberg96@xxx.com -d 1000

@bronzdoc
Copy link
Member

bronzdoc commented Nov 2, 2016

@djberg96 I investigated it a little more and it seems that OptionParser will try to match a single letter flag to any existing flag, e.g -l will match '--list' in this case since there's no flag that explicitly defines the behavior of -d it will match to --debug which is a common option in rubygems.

@djberg96
Copy link
Contributor Author

djberg96 commented Nov 2, 2016

@bronzdoc Ok, thanks for looking into that.

@djberg96 djberg96 closed this as completed Nov 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants