[pyOpenSSL] pyOpenSSL certificate information - how?

Jos Vos jos at xos.nl
Wed Jul 14 14:34:10 CEST 2004


Hi,

I have started to experiment with client certificates and I want
to check some information of these certificates, but I can't get
that part working.

What I do:

  ctx.set_verify(SSL.VERIFY_PEER|SSL.VERIFY_FAIL_IF_NO_PEER_CERT, cb)

And in the cb function I do:

  def cb(conn, cert, errnum, depth, ok):
    subject = cert.get_subject()
    print subject

This actually works and gives me:

  <X509Name object '/CN=Simple Client'>

(I'm using some sample certificates of Red Hat Linux 9's Apache).

But now I want to retrieve some information from that certificate...
In the manual section about X509Name objects it says "X509Name objects
have the following members", but I don't succeed in getting any of
that information.

I'm obviously making one or more stupid mistakes, using this interface
for the first time (using some third-party sample programs), but I
don't know which mistakes...

Any help is appreciated. 
Cheers,

--
--    Jos Vos <jos at xos.nl>
--    X/OS Experts in Open Systems BV   |   Phone: +31 20 6938364
--    Amsterdam, The Netherlands        |     Fax: +31 20 6948204




More information about the pyopenssl-users mailing list