Convert Apache2 certificate to IIS (pfx) format

Sometimes you purchase a certificate for Apache or Nginx and end up eventually installing it in IIS as well. This happens a lot with widcard certificates which seem to propagate.

To import a certificate with key for IIS, you need to convert the certificate and its key from what your Apache server used to something that windows will allow you to import, but the command to do so is hard to remember.

openssl pkcs12 -export -in my.crt -inkey my.key -out my.pfx

To import the .pfx file, go here: http://www.sslshopper.com/move-or-copy-an-ssl-certificate-from-a-windows-server-to-another-windows-server.html

Don’t forget you will need to import any intermediate certificates as well, but you don’t have to convert them to .pfx first.

You can also import the intermediates

openssl pkcs12 -export -in my.crt -inkey my.key -out my.pfx -certfile intermediateCA.crt

 

This entry was posted in Linux, SSL, windows. Bookmark the permalink.

Comments are closed.