How to Get Modulus Info on an SSL Certificate

When your SSL keys and certificates fall out of sync let the headaches begin.

Here is a common error from apache: Error: “Unable to configure RSA server private key”

Check to see if they are in sync using openssl. Compare the modulus values of both the key and the certificate. Here is how to get the modulus information out of the public key file and the certificate file:

Certificate File:

openssl x509 -noout -text -in [certificate_filename] -modulus

Public Key File:

openssl rsa -noout -text -in [public_key_filename] -modulus 
[ linux ]