x509-parser icon indicating copy to clipboard operation
x509-parser copied to clipboard

Example print_cert skips signature verification for self-signed certs

Open sbellem opened this issue 2 months ago • 0 comments

The current code, under examples/print_cert.rs, checks whether the subject and issuer are the same with

https://github.com/rusticata/x509-parser/blob/b7dcc9397b596cf9fa3df65115c3f405f1748b2a/examples/print-cert.rs#L221

At least, with the self-signed certificates I am trying the example against, the condition check returns false even though the subject and issuer are the same. Using something like

        if x509.subject().to_string() == x509.issuer().to_string() {

fixes the issue.

More broadly this seems to be related to #20.

sbellem avatar Oct 21 '25 04:10 sbellem