Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

verify if server certificate matches with root CA certificate

I have a SSL server certificate for a server and I have a root CA certificate that the client can verify this server certificate during SSL handshake. For some reason I am not sure if I really retrieved the right root certificate. Is there any way where I can see if I have the right root certificate? Maybe an openssl command in which I provide both files and the output tells me "root CA certificate confirms SSL certificate".

Is that possible?

Thanks.

like image 276
AndyAndroid Avatar asked Jan 11 '23 18:01

AndyAndroid


1 Answers

The command is openssl verify -CAfile ca.crt server.crt
If the two certificates match, the command will return server.crt: OK

The above command is only for pem format.
If you has .p12 file, then first convert it to pem format:
openssl pkcs12 -in server.p12 -out server.crt -nodes

like image 110
onemouth Avatar answered Jan 23 '23 13:01

onemouth