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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building a CA fail #113

Open
Maagoul opened this issue Sep 26, 2016 · 1 comment
Open

Building a CA fail #113

Maagoul opened this issue Sep 26, 2016 · 1 comment

Comments

@Maagoul
Copy link

Maagoul commented Sep 26, 2016

I am CA but it fail always in generating serial steps I execute the r509 --out root.cer --keyout root.key then I put my parameters but always it throw me this 馃憤

/usr/local/lib/ruby/gems/2.0.0/gems/r509-0.10.0/lib/r509/certificate_authority/signer.rb:146:in to_s': OpenSSL::BNError from /usr/local/lib/ruby/gems/2.0.0/gems/r509-0.10.0/lib/r509/certificate_authority/signer.rb:146:increate_serial'
from /usr/local/lib/ruby/gems/2.0.0/gems/r509-0.10.0/lib/r509/certificate_authority/signer.rb:130:in build_cert' from /usr/local/lib/ruby/gems/2.0.0/gems/r509-0.10.0/lib/r509/certificate_authority/signer.rb:81:inselfsign'
from /usr/local/lib/ruby/gems/2.0.0/gems/r509-0.10.0/bin/r509:111:in <top (required)>' from /usr/local/bin/r509:23:inload'
from /usr/local/bin/r509:23:in `

'

@reaperhulk
Copy link
Member

Try running this script on your system and see what the output is:

require 'openssl'

rand = OpenSSL::BN.rand(96,0) # 96 bits is 12 bytes (octets).
serial = OpenSSL::BN.new((Time.now.to_f*1000000).to_i.to_s + rand.to_s)
puts serial.to_s

This is extracted from the code that failed

serial = OpenSSL::BN.new((Time.now.to_f*1000000).to_i.to_s + rand.to_s)

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