In the keychain, export your private key and certificate in PKCS # 12 format (.p12 file, Personal Information Exchange). You must do this by expanding your private key (in Keychain Access), right-clicking its certificate and using Export. You will probably ask for a password to protect this p12 file.
Then in the terminal, extract the private key using OpenSSL:
umask 0077 openssl pkcs12 -in filename.p12 -nocerts -nodes -out filename-key.pem umask 0022
- Note that you must protect this file since the private key will not be password protected (so it can be used by Apache Httpd).
Similarly, for the certificate (although it seems that you already have it in PEM format, so you may not need this step):
openssl pkcs12 -in filename.p12 -clcerts -nokeys -out filename-cert.pem
Then set the SSLCertificateFile
(cert) and SSLCertificateKeyFile
(private key) to point to these files in your Apache Httpd configuration.
source share