Tuesday, June 28, 2011

Apache create wildcard cert and convert to Windows

A good conversion site is:  https://www.sslshopper.com/ssl-converter.html


Make the Apache cert:

  1.  cd /etc/httpd/conf/ssl/
  2. openssl genrsa -out wildcard.com.key 2048
    1. This generates a 2048-bit key with no password
  3. openssl req -new -key wildcard.com.key -out wildcard.com.csr
    1. Make sure your Common Name is:  *.wildcard.com
    2. Don't put a password in the extra attributes
  4. Buy the wildcard cert from a Certificate authority and use the contents of the wildcard.com.csr file to get your cert ... make sure it shows *.wildcard.com before you buy
  5. The Certificate authority will provide a zip file with the wildcard.com.crt and any intermediate certs (gd_bundle.crt)

Create the PEM file:

  1. cat wildcard.com.key > wildcard.com.bundle.pem
  2. cat wildcard.com.crt >> wildcard.com.bundle.pem
  3. cat gd_bundle.crt >> wildcard.com.bundle.pem
  4. You now have a .pem file by the name of wildcard.com.bundle.pem

Create a Windows usable certificate:

  1. openssl pkcs12 -export -in wildcard.com.bundle.pem -out wildcard com.bundle.p12 -name *.wildcard.com
  2. NOTE:  make sure not to put an export password
  3. You now have a wildcard.com.bundle.p12 file

Import certificate into Windows:

  1. Login to Windows as an Administrator
  2. At the run prompt, type:  mmc
  3. File --> Add/remove add-ins
  4. Choose Certificates --> Local computer
  5. Go to the Personal --> Certificates directory
  6. Right click the Certificates directory and choose import
  7. Import the wildcard.com.bundle.p12 file (you'll need to modify the selection to see it)
  8. Mark the Certificate as Exportable
  9. Use Extended Attributes IF asked
  10. Once the import is complete, you can now go to your individual IIS sites and use the *.wildcard.com certificate