In previous article, we have mentioned about Enabling caching on IIS and how to Redirect from non-www to www website using IIS (and Vice-Versa), but now in this article, I have provided step by step procedure to generate CSR on IIS and then once we have got certificate file from hosting website, install SSL  certificate or we can say way to import SSL on IIS, Windows server.

Generate CSR on IIS

Let's begin by creating or generating CSR on IIS, here are the steps which you need to follow, in order to create CSR using IIS on Windows server.

  1. Log in into your Windows server using Remote desktop connection
  2. Once you are logged in into your server, open Internet Information Services (IIS) Manager
  3. In the left Connections menu, select the server name (host) where you want to generate the request.
  4. Now, on the right side, you will see "Server Certificate" Option, double-click on it, to open it.
  5. Now, you need to select "Create Certificate Request" from the "Actions" pane on the right side
    Then you need to fill in the pop-up form, as shown above.
    Common name: Your website domain name
    Organization: Organization Name
    Organization Unit: The name of your department within the organization. This entry will usually be listed as "IT", "Web Security", or is simply left blank.
    City/Locality: Your Organization/company City.
    State/Province: Your Organization/company State.
    Country/Region: The country/region where your company is legally located.
  6. Once, you are done with above pop-up, in next screen, select "Microsoft RSA SChannel Cryptographic Provider" and "2048" encryption, unless you have specific cryptographic provider and bit length.
  7. Click "Next" and in next screen you need to select local disk location to save generate .csr file

Once you have generate CSR, it will looks like below text, which you will need to upload on SSL certificate provider website like Godaddy or Namecheap


Once you will submit this CSR, then Godaddy or Namecheap or any other SSL provider, will generate certificate file in .crt or .pk7b format.

Import SSL on IIS

Once you have generated CSR, you will to need to follow below instructions

  1. On the server where you created the CSR, save the SSL certificate .cer file (e.g., example_domain.cer) that you received from SSL provider.
  2. From the Start screen, find Internet Information Services (IIS) Manager and open it.
  3. In the Connections pane, locate and click the server.
  4. In the server Home page (center pane) under the IIS section, double-click "Server Certificates".
  5. In the Actions menu (right pane), click Complete Certificate Request and browse the ".crt" file to be uploaded, as shown below

  6. Once you will, click on "OK", you will be able to see Certificate in "Server Certificates" mid pane.

Assign SSL to website

Once you have imported SSL on IIS, now you can assign it your website, which is very simple process, here are the steps to follow it

  1. In Internet Information Services (IIS) Manager, in the Connections pane, expand the name of the server on which the certificate was installed. Then expand Sites and click on the site you want to secure using the SSL certificate.
  2. Now, click on the "Bindings" from right "Actions" pane.
  3. In the Site Bindings window, click "Add"
  4. In the pop-up, you need to select "https" as binding type, and your certificate, with port as ":443", as shown below
  5. That's it, we are done.

This is how you can generate CSR and import SSL on IIS, you can follow same steps in IIS 7/8 or 8.5,10.

If you haven't bought SSL yet, you can buy at cheaper price on Godaddy or Namecheap.

You may also like to read:

Enabling caching on IIS

how to Redirect from non-www to www website using IIS (and Vice-Versa)

Best and Cheap Windows VPS Hosting Providers

Bulk Insert in ASP.NET Core MVC using Entity Framework Core