I’m working on Boss Linux OS. I’m trying to work out how to validate a SSL certificate and also retrieve the SSL/TLS version used, cipher used and the algorithm (SHA, MD5..), expiry date of the certificate used by the site passed as parameter
openssl s_client -connect http://www.google.com:443
using this command helps me view the certificate of http://www.google.com. Now from that output i need to extract the SSL/TLS version used by them, cipher used, algorithm used, expiry date of the certificate and so on… I need to write a PHP program to extract those values.
If you’re familiar with OpenSSl, http://php.net/manual/en/book.openssl.php, then you might be able to make a very small PHP file like so:
Variable $certificate is collected by a simple form (upload form perhaps?) so you can analyze a raw certificate file.
Could you though, maybe provide more information on the type of SSL certificate?
You’re not going to be able to figure out the cipher very easily, it will take something like Cain and Abel and a powerful processor, and lots of time.