Jump to content
Updating IPB tonight Read more... ×


This topic is now archived and is closed to further replies.


SSL Problem

Recommended Posts


I've been trying for a few days to make a script which would loop through a list of IPs through HTTPS connections and, if the server happens to issue a certificate, I'd like to fetch the issuer and user of said certificate and log that into a text file.

Now, connecting and looping isn't really hard, but I can't figure out how to get the certificate. I know how to parse it (once I get (somehow) the x509cert data), but the documention on that part seems to be lacking on the web. I've looked in the Zend CVS, and since PHP 5.1.3, apparently there are now two new SSL Context Options, capture_peer_cert and capture_peer_cert_chain, which would seem to be what I need. Unfortunately, I have no idea how to use those, and then they say the certificate data (in x509 format) will be returned as a SSL Stream Context variable, something I didn't even know about.

If anyone could help me out, I'd appreciate.  :)

Edit : Apparently, everywhere I've posted this no one's been able to help me...Where could I get support for this issue then, if no one on common php boards knows anything about it?

Share this post

Link to post
Share on other sites
have you looked at the php.net info on this subject?


Share this post

Link to post
Share on other sites
I did, but the answer wasn't there.

However, I did fix my problem. You simply put the 'capture_peer_cert' in the 'ssl' wrapper in the stream context, and once connected, you fetch the new context and if there is a certificate, it'll return it in the context under the wrapper 'ssl' as 'peer_certificate'.

While I had understand that much, I'd forgotten to put -with--openssl[=DIR]


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.