verify if server certificate matches with root CA certificate

certificate, openssl, ssl, ssl-certificate

Solution

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`

Problem

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.

Original source