Hi Vladimir, Thanks for your reply!
What I need is .PEM format. Could you please provide an example about how to use OpenSSL.crypto.dump_certificate(*type*, *cert*)? Cheers, Kayne. On Wed, Jul 1, 2015 at 4:12 PM, Vladimir Didenko <vladimir.dide...@gmail.com > wrote: > 2015-07-01 17:03 GMT+03:00 Kai Lu: > >> Hi, >> >> Could anyone please tell me how to get each certificate (like "begin >> ... end") in the cert chain by using "peercertchain = >> conn.get_peer_cert_chain()"? I use PyOpenssl package. The command line >> like openssl s_client -showcerts -connect XXXX:443 2>/dev/null can print >> out what I need, but I want to use PyOpenssl package or other packages to >> implement it in the Python programs other than calling command line from >> Python code. >> > > I don't understand what is a problem. conn.get_peer_cert_chain returns > usual Python list of X509 objects. Each object is certificate. If you need > PEM format you can use crypto.dump_certificate function. > > > -- > Regards, > Vladimir. > > _______________________________________________ > Cryptography-dev mailing list > Cryptography-dev@python.org > https://mail.python.org/mailman/listinfo/cryptography-dev > >
_______________________________________________ Cryptography-dev mailing list Cryptography-dev@python.org https://mail.python.org/mailman/listinfo/cryptography-dev