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 www.yourdomain.com.pfx -nocerts -out www.yourdomain.key.pem
# openssl pkcs12 -in www.yourdomain.com.pfx -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>
 ServerName www.yourdomain.com
 Redirect permanent / https://www.yourdomain.com/
</VirtualHost>

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

Filed under: Uncategorized |

4 Comments

  1. Jack December 2, 2009 @ 5:32 pm

    May I say your blog post was compelling and rich. Whats your twitter ID?

  2. chaimaster December 9, 2009 @ 3:13 pm

    Dear Author blog.dastrup.com !
    I consider, that you are not right. Let’s discuss. Write to me in PM.

  3. andydobry December 25, 2009 @ 6:31 am

    I want to quote your post in my blog. It can?
    And you et an account on Twitter?

  4. Гарант January 23, 2010 @ 7:19 pm

    Это должно быть в цитатнике