Hoy tuve que migrar de IIS7 a Apache un dominio que tenía configurado un certificado SSL. No contaba con los ficheros necesarios para configurar la conexión segura en Apache (certificado y llave privada), ya que IIS7 los guarda encriptados en un formato propio. Afortunadamente después de mucho trastear, encontré la manera de sacar la información desde el fichero exportado por IIS7 (.PFX). Se trata de utilizar el comando «openssl», que se instala con Apache en la carpeta bin, de la siguiente manera:
1. Exportar la llave privada del fichero pfx
openssl pkcs12 -in fichero_exportado_de_iis.pfx -nocerts -out llave.pem
2. Exportar el certificado del fichero pfx
openssl pkcs12 -in fichero_exportado_de_iis.pfx -clcerts -nokeys -out certificado.pem
3. Eliminar la clave que se adjunta a la clave privada, para que Apache no pregunte por la misma cuando arranca
openssl rsa -in llave.pem -out llave_lista.key
Ya podemos utilizar certificado.pem y llave_lista.key en nuestro fichero de configuración de Apache para configurar nuestro dominio con soporte para SSL.
Comment