I need display in web page fingerprints of SSL Certificate. Is it possible in PHP? The function
openssl_x509_parse
doesn't return SHA1 and MD5 fingerprints. How resolve this problem? Thanks.
I need display in web page fingerprints of SSL Certificate. Is it possible in PHP? The function
openssl_x509_parse
doesn't return SHA1 and MD5 fingerprints. How resolve this problem? Thanks.
I think you can generate the SHA fingerprint with the following code:
From PHP 5.6 onwards, you can use
openssl_x509_fingerprint()
:The function is currently undocumented, but this will be fixed at release time; this is the function signature:
I'd guess the easiest way is going to be to call openssl through system
And yes, I know, this is nothing like a clean way of doing this - however, it's the only one I can think of of the top of my head!!!
Here is a better solution:
Based on your information, I wrote a tiny certificate viewer in PHP
Use as your starting point to bake your own viewer.