cchandler / certificate_authority

Ruby gem for managing the core functions outlined in RFC-3280 for PKI
https://github.com/cchandler/certificate_authority
194 stars 44 forks source link

Weird certificate signing request bug #21

Closed emonti closed 12 years ago

emonti commented 12 years ago

This is a weird one - the DN for issuer seems to get reversed, which appears to be causing things like nginx to fail validation.

I don't have an explanation, could be my code is wrong in the example - could also be ruby OpenSSL:: doing something unexpected...

  1) Signing a CSR should issue a certificate verified by the issuer
     Failure/Error: @issued.issuer.to_s.should == @issuer.subject.to_s
       expected: "/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=Gatekeeper CA"
            got: "/CN=Gatekeeper CA/O=Internet Widgits Pty Ltd/ST=Some-State/C=AU" (using ==)
     # ./spec/units/csr_signing_spec.rb:124:in `block (2 levels) in <top (required)>'
emonti commented 12 years ago

Interesting. I get two other test failures, possibly related on "ruby 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]" (system default on my macbook).

     rspec ./spec/units/signing_request_spec.rb:32 # CertificateAuthority::SigningRequest should generate a proper DN from the CSR
     rspec ./spec/units/signing_request_spec.rb:70 # CertificateAuthority::SigningRequest transforming to a certificate should be signable w/ a serial number

EDIT: disregard - i think this was a red herring - also 1.8.7 is deprecated