If your certificate does not match to private key and throwing an error, this article will help to verify that you are using correct private key or certificate.
In this article I will provide you two method to verify if certificate, private key and CSR match.
Method #1 : Using OpenSSL and MD5
Using md5 value of the certificate, private key and CRS should be same for all, if you are getting different md5 value it means your certificate, private key and CRS does not match.
# openssl rsa -noout -modulus -in example.key | openssl md5 # openssl req -noout -modulus -in example.csr | openssl md5 # openssl x509 -noout -modulus -in example.crt | openssl md5
Method #2 : Using OpenSSL and sha256sum
In this method check the SHA sum values of all the files and check if the value of all files are same.
# openssl pkey -in example.key -pubout -outform pem | sha256sum # openssl x509 -in example.crt -pubkey -noout -outform pem | sha256sum # openssl req -in example.csr -pubkey -noout -outform pem | sha256sum