Tuesday 20 April 2010

converting certificate from IIS to Apache

If you have a pfx file for IIS web server but you need the relevant key and certificate files for Apache web server the following will be very usefull:


# Export the private key file from the pfx file
openssl pkcs12 -in filename.pfx -nocerts -out key.pem
# Export the certificate file from the pfx file
openssl pkcs12 -in filename.pfx -clcerts -nokeys -out cert.pem
# This removes the passphrase from the private key so Apache won't
# prompt you for your passphase when it starts
openssl rsa -in key.pem -out server.key