How to… (dealing with certificates)Certificates must be in PEM format and may need hashing in order for OpenSSL to find the correct certificate. This section describes:
To find out which server certificate is
required To find out which server root certificate is required by a secured website or web service, use the OpenSSL command openssl s_client –showcerts –connect host:port. For example::
In the output of the command you will find the certificate chain that is used by the secured connection. Look for the words “Certificate chain”. Under these words you will find text that resembles the following:
You may have noticed that the issuer of a certificate (preceded with “i:” in the output) is the subject of the certificate (preceded with “s:” in the output) that is next in the chain. The required root certificate is the one whose subject equals the issuer of the last certificate in the chain.
| |||