Checking the compliance of the key and ssl certificate

Checking the compliance of the key and ssl certificate

It was necessary to replace the ending ssl certificate for the site, and the apache web server did not start due to the mismatch between the files example_ru.crt and example_ru.key.

To check, you need to calculate the md5 sum of each file, and these sums must match.

Go to the directory where we have the files

[[email protected] ~]# cd /etc/pki/tls/certs/

Calculate the md5 sum of the SSL certificate example_ru.crt

[[email protected] ~]# openssl x509 -noout -modulus -in example_ru.crt | openssl md5
(stdin)= 04c798ddffe50a19c7b1302b29e43798

Calculate the md5 sum of the private key example_ru.key

[[email protected] ~]# openssl rsa -noout -modulus -in example_ru.key | openssl md5
(stdin)= 04c798ddffe50a19c7b1302b29e43798

Calculate md5 sum of CSR module

[[email protected] ~]# openssl req -noout -modulus -in example_ru.csr | openssl md5
(stdin)= 04c798ddffe50a19c7b1302b29e43798

As you can see, the md5-sums of all files are the same.

Sidebar