Check whether your private key matches your SSL certificate
Check whether your private key matches your SSL certificate

Check whether your private key matches your SSL certificate

If you want to check whether your private key matches your SSL certificate, there are three openssl command to run on:

  • the certificate file
  • the private key file
  • the certificate request file

All of the three outputs have to be the same. The commands are the following:

  • check the certificate file:
    $ openssl x509 -noout -modulus -in certificate.cer | openssl md5
    (stdin)= e3f6fa12345cdf89e7b3a2f4ff4d267e
    

     

  • check the private key file:
    $ openssl rsa -noout -modulus -in private.key | openssl md5 
    (stdin)= e3f6fa12345cdf89e7b3a2f4ff4d267e
    

     

  • check the certificate request file:
    $ openssl req -noout -modulus -in request.csr | openssl md5
    (stdin)= e3f6fa12345cdf89e7b3a2f4ff4d267e
    

     

<>

My Powershell script categories

Check whether your private key matches your SSL certificate

Leave a Reply

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