Jump to content


Photo

SSL Problem


  • Please log in to reply
2 replies to this topic

#1 CTM

CTM
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 02 August 2006 - 04:55 PM

Hi,

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?

#2 bltesar

bltesar
  • Members
  • PipPipPip
  • Advanced Member
  • 109 posts

Posted 03 August 2006 - 02:22 PM

have you looked at the php.net info on this subject?

http://us3.php.net/m...ref.openssl.php



#3 CTM

CTM
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 04 August 2006 - 08:14 PM

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]

Eh...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users