How to convert your certificate to the PEM format?
The web server software (Apache) only supports PEM certificates. There are several options to convert certificates to the PEM format:
Using an online convertor. For more info on how to convert a certificate file to pem format via an online tool you can search on the internet for "convert to pem online" for example. Note that this option is most likely the easiest and fastest but it requires to upload your private key which is not advised from a security perspective.
If your certificate is in pfx format you can use a Windows Powershell module called PSPKI. For more info on how to convert a pfx file to pem format using powershell you can search on the internet for "pspki powershell pfx to pem" for example.
On Linux systems OpenSSL can be used to convert certificates in a different format to PEM using the following commands:
Convert x509 to PEM
openssl x509 -in certificate.cer -outform PEM -out certificate.pem
Convert DER to PEM
openssl x509 -inform der -in certificate.cer -out certificate.pem
Convert PFX to PEM
openssl pkcs12 -in certificate.pfx -out certificate.pem
Convert PKCS7/P7B to PEM
openssl pkcs7 -print_certs -in certificate.p7b -out certificate.pem