How to Transfer an SSL/TLS Certificate from cPanel/Apache to IIS
-
Moving a website from Apache to Microsoft IIS does not always require purchasing a new SSL/TLS certificate. All TLS products purchased via GoGetSSL support unlimited server licensing, so If you have the original certificate and its matching private key, you can export them into a PFX file and import it into IIS.
If the private key is unavailable, you can generate a new one and request a certificate reissue. More about reissue process.
- Automatic renewals
- Less manual work
-
-
*
Option 1: Transfer the Existing Certificate Using a PFX File
A PFX file contains an SSL/TLS certificate, its corresponding private key, and optionally the intermediate certificate chain. IIS supports importing certificates in this format.
-
*
Step 1: Locate Your Certificate and Private Key
Find the following files on your cPanel-managed hosting account:
- Private Key: .key
- SSL/TLS Certificate: .crt or .pem
- CA Bundle: Intermediate certificates, if available.
In cPanel, open Security → SSL/TLS (or SSL/TLS Certificates) to access your private keys and certificates. The available options depend on your hosting provider's configuration.
You do not necessarily need root or SSH access if you can retrieve these files through cPanel.
-
*
Step 2: Create a PFX File
Use OpenSSL to export the certificate and private key:
openssl pkcs12 -export -out example.com.pfx -inkey example.com.key -in example.com.crt -certfile ca-bundle.crtReplace the file names and paths with your actual files. If you do not have a separate CA bundle, omit the -certfile option.
OpenSSL will prompt you to set an export password. Keep it safe because you will need it when importing the PFX file into IIS.
-
*
Step 3: Import the PFX File into IIS
- Open IIS Manager.
- Select your server name.
- Open Server Certificates.
- Click Import.
- Select the PFX file and enter its password.
- Select the Personal certificate store.
- Click OK.
-
*
Step 4: Configure the HTTPS Binding
- Expand Sites and select your website.
- Click Bindings → Add or edit the existing HTTPS binding.
- Set the type to https and the port to 443.
- Select the imported SSL/TLS certificate.
- Click OK.
Visit your website over HTTPS to verify the installation.
-
*
Option 2: Reissue the Certificate for IIS
If you cannot access the original private key, you cannot create a PFX containing it. Instead, generate a new private key and CSR on the Windows server and request a certificate reissue.
- Open IIS Manager and select your server.
- Open Server Certificates.
- Click Create Certificate Request.
- Enter your organization and domain details, select the key size, and save the CSR.
- Submit the CSR to GoGetSSL through the certificate reissue process.
- Once the replacement certificate is issued, return to Server Certificates and select Complete Certificate Request.
- Select the issued certificate file and complete the installation.
Finally, configure the HTTPS binding as described in Option 1.
-
*
Conclusion
You can transfer an existing SSL/TLS certificate from cPanel or Apache to IIS by exporting it as a PFX file, provided you have its matching private key.
If the private key is lost, request a certificate reissue using a new CSR generated on the Windows server.
In either case, verify the certificate and HTTPS binding before removing the files from the original server. Keep PFX files and private keys secure, as they allow access to your certificate's private key.
-