PHP Script to verify private key matches SSL certificate?

OpenSSL command can be used to verify if an SSL certificate matches a private key file. You need to find the checksum for the SSL certificate and Private key, if both checksums are the same, then the key matches.

To make this process easier, I created a PHP script to verify if the SSL certificate matches the private key provided.

Create a file

Advertisement

mkdir ~/bin/
vi ~/bin/ssl-verify

Add following content

#!/usr/bin/php

Make it executable
chmod 755 ~/bin/ssl-verify

To verify an SSL and key file, go to the folder where the SSL certificate and key file are present, then run the command
ssl-verify
Add a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Advertisement