You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
== on certificates seems to compare ... strings? #158
Given two instances of a certificate, how can I determine if it's the same certificate?
I feel that == ought to do the trick.
It does not, as I think it looks for eq() (same object).
I can get around this using, for instance: certA.to_der == certB.to_der, which gives me a byte-comparison equality. That's great if they are actually the identical certificate (which in my present case, I care about), but I find nothing to do essentially, if certA.issuer == certB.issuer, then certA.subject == certB.subject.
Should it be == that does this?
Activity
rhenium commentedon Oct 10, 2017
I think OpenSSL::X509::Certificate#== should do a byte-by-byte comparison.
rhenium commentedon Oct 22, 2017
#161 has been merged to master. v2.1.0 will include those == methods.
Compare certificates byte-by-byte as DER
Fix comparision of X509 certs in old Ruby versions