in reply to Examining SSL Certificates of SMTP hosts using Perl

I can't tell you the exact solution, but I had a quick look at your problem and I'll make some suggestions where you might want to look deeper.

IO::Socket::SSL uses Net::SSLeay as its wrapper around OpenSSL. The POD for the latter says it doesn't have a complete x509 interface and that dump_peer_certificate returns "selected" information.

There is a low-level routine in Net::SSLeay called sslcat that does more general things, including grabbing the whole certificate.

Perhaps using the lower-level Net::SSLeay stuff will get you a certificate you can save to a temp file and specify to Crypt::OpenSSL::X509. I haven't tried it, but that's where I'd start based on the docs for these three modules.

Replies are listed 'Best First'.
Re^2: Examining SSL Certificates of SMTP hosts using Perl
by Anonymous Monk on Feb 18, 2009 at 13:09 UTC
    See the QuickRef in the Net::SSLeay package for more details, but you could get the X509 certificate by smth like this: Net::SSLeay::PEM_get_string_X509( $CLIENT->peer_certificate() ). $CLIENT->peer_certificate() returns integer number which represents a certificate from the cert-store