tencent cloud


Installing an SSL Certificate on an IIS Server

Last updated: 2023-05-11 11:39:49


    This document describes how to install an SSL certificate in IIS.


    • The certificate name cloud.tencent.com is used as an example. The actual name in your certificate shall prevail.
    • Windows Server 2012 R2 is used as an example. Detailed steps vary slightly by OS.
    • Before you install an SSL certificate, enable port 443 on the IIS server so that HTTPS can be enabled after the certificate is installed. For more information, see How Do I Enable Port 443 for a VM?.
    • For detailed directions on how to upload SSL certificate files to a server, see Copying Local Files to CVMs.


    Installing the certificate

    1. Log in to the SSL Certificate Service console, and click Download for the certificate you need to install.

    2. In the pop-up window, select IIS for the server type, click Download, and decompress the cloud.tencent.com certificate file package to a local directory.
      After decompression, you can get the certificate file of the corresponding type, which contains the cloud.tencent.com.iis folder.

    • Folder: cloud.tencent.com.iis

    • Files in the folder:

      • cloud.tencent.com.pfx: certificate file

      • keystorePass.txt: password file (if you have set a private key password, this file will not be generated)

    1. Open the IIS Manager, select the computer name, and double-click Server Certificates.

    2. In the Actions column on the right of the Server Certificates window, click Import.

    3. In the Import Certificate pop-up window, select the path where the certificate file is stored, enter the password, and click OK as shown below:


    • If you have set a private key password when applying for the certificate, enter the private key password; otherwise, enter the password in the keystorePass.txt file in the cloud.tencent.com.iis folder.
    • If you forgot your private key password, submit a ticket to have the certificate deleted and reapply for one under the domain.
    1. Select the name of a site in Sites and click Bindings in the Actions column on the right.

    2. In the Site Bindings pop-up window, click Add.

    3. In the Add Site Binding window, set Type to https, IP address to All Unassigned, and Port to 443, enter the domain of your current certificate in Host name, specify the corresponding SSL certificate, and click OK.

    4. Then, you can see the newly added content in the Site Bindings window.

    5. Access the website through https://cloud.tencent.com.

    - [404 Error After the SSL Certificate is Deployed on IIS](https://intl.cloud.tencent.com/document/product/1007/39820)

    (Optional) Security configuration for automatic redirect from HTTP to HTTPS


    • For normal redirect, edit the rule in the following steps. If you have other needs, you can set it on your own.
    • During the redirect from HTTP to HTTPS, if your website element contains external links or uses the HTTP protocol, the entire webpage is not completely based on HTTPS. In this case, some browsers may prompt for risk such as "this link is unsecure" due to those factors. You can view the error cause by clicking Details on the unsecure page.
    1. Open the IIS Manager.

    2. Select the name of a site in Sites and double-click to open URL Rewrite.


      Download and install the URL Rewrite module before performing this step.

    1. Go to the URL Rewrite page and click Add Rule(s) in the Actions column on the right.

    2. In the Add Rule(s) pop-up window, select Blank rule and click OK.

    3. Go to the Edit Inbound Rule page.

    • Name: Enter Forced HTTPS.

    • Match URL: Enter (.*) in Pattern.

    • Conditions: Click to expand and click Add to pop up the Add Condition window.

      • Condition input: {HTTPS}.

      • Check if input string: Select "Matches the Pattern" by default.

      • Pattern: Enter ^OFF$.

    • Action: Enter the following parameters.

      • Action Type: Select "Redirect".

      • Redirect URL: https://{HTTP_HOST}/{R:1}.

      • Redirect Type: Select "See Other (303)".

    1. Click Apply in the Actions column to save.

    2. Return to the Sites page and click Restart in the Manage Website column on the right. Then, the website can be accessed through http://cloud.tencent.com.


    If anything goes wrong during this process, contact us.

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support