Main Contents

Convert IIS SSL Cert to Apache

November 27, 2009

Export your SSL Cert to a PFX file and include the private key. Copy it to your apache server.

# openssl pkcs12 -in -nocerts -out www.yourdomain.key.pem
# openssl pkcs12 -in -clcerts -nokeys -out www.yourdomain.cert.pem
# openssl rsa -in www.yourdomain.key.pem -out www.yourdomain.key

Copy contents of www.yourdomain.cert.pem between and including BEGIN CERTIFICATE and END CERTIFICATE into www.yourdomain.cert.

Here’s a sample apache virtualhost config file that includes redirecting the non-SSL site to the new SSL site:

<VirtualHost *:80>
 Redirect permanent /

<VirtualHost *:443>
 DocumentRoot /var/www/html
 <Directory /var/www/html>
  AllowOverride All
 SSLEngine on
 SSLCertificateFile /path/to/www.yourdomain.cert
 SSLCertificateKeyFile /path/to/www.yourdomain.key

Filed under: Linux, Microsoft, Uncategorized, Windows |

Sorry, the comment form is closed at this time.