SSL Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Telius
Forum Newbie
Posts: 3
Joined: Wed Aug 02, 2006 9:27 am

SSL Problem

Post by Telius »

Hi,

I'm currently trying to create a script which would loop through a list of IPs, open a socket to the 443 port (a HTTPS connection) and, if the webserver is issuing a certificate, I'd like to be able to log the certificate's issuer and user in a file.

Now, connecting to a site with an HTTPS connection isn't very hard, nor is the looping through a list...I'm having a hard time fetching the certificate and logging its issuer and user.

Actually, I can't do it at all. I've checked for documention on how to use the OpenSSL extension with PHP (I'm using 5.1.4), but so far there is very little, except the OpenSSL functions, but I have no idea how to obtain an x509cert data type. I've checked the Zend website, and noticed that since 5.1.3 there are two new SSL Context options, capture_peer_cert and capture_peer_cert_chain, which would most likely help me out alot, but I have no idea how to use them in practice.

I'm a very visual person, so a code snippet followed by an explanation would greatly help me out.

Thanks :)

Edit : I'm guessing no one will ever answer this until some documentation is issued by Zend concerning their newest additions to the OpenSSL extension...
Post Reply