| 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: How to convert a number of formats to PEM format. How to generate hashed file names of certificates. Other commands that may prove handy at some point. To find out which server certificate is required To find out which server certificate is required by a secured website or web service, use the OpenSSL command openssl s_client -connect host:port. For example: `openssl s_client -connect ccapi.client.qvalent.com:443` In the output of the command you will find the certificate in PEM format between the -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- tags: `-----BEGIN CERTIFICATE-----` `MIIEnDCCBAWgAwIBAgIQIquv6LzsIuLt0+gYXajhMjANBgkq` `…` `-----END CERTIFICATE-----` Save the certificate to a file, including the BEGIN and END tags, and see “To view the contents of a PEM certificate” to view the contents of the certificate. |