Securing your websites hosted on Windows Server with Internet Information Services (IIS) is no longer optional; it’s essential for user trust, data protection, and even SEO. The process involves two key stages: first, you need to Generate CSR on Windows using IIS tools to request an SSL/TLS certificate, and second, once you receive the certificate, you must install it and enable HTTPS on IIS by configuring site bindings.
This comprehensive guide walks you through both generating the Certificate Signing Request (CSR) and the subsequent steps to activate secure HTTPS connections for your IIS website.
Key Takeaways
- Two Main Steps: Securing IIS involves (1) Generating a CSR using IIS Manager and submitting it to a Certificate Authority (CA), and (2. Installing the issued certificate and configuring IIS bindings to enable HTTPS.
- CSR Generation: Use the “Create Certificate Request…” feature in IIS Server Certificates. Accurate information (especially the Common Name) is vital. This process also creates the private key on the server.
- Private Key & Pending Request: The private key associated with the CSR remains hidden on the server. A “pending request” appears in IIS – do not delete it before installing the certificate.
- Certificate Installation: Use the “Complete Certificate Request…” action in IIS after receiving the certificate files (
.p7b
or.crt
) from your CA. - HTTPS Binding: Create a new site binding for type ‘https’ on port 443, selecting the newly installed SSL certificate.
- Verification: Always test the HTTPS connection and check firewall rules after configuration.
Part 1: Generate CSR on Windows (Using IIS Manager)
This is the starting point for obtaining your SSL certificate.
Information Needed (Distinguished Name – DN):
Collect this accurately beforehand:
- Common Name (CN): The Fully Qualified Domain Name (FQDN) you want to secure (e.g.,
www.yourdomain.com
,secure.app.yourdomain.com
). For Wildcards:*.yourdomain.com
. This must match exactly how users access the site. - Organization (O): Your official, registered business name (Required for OV/EV).
- Organizational Unit (OU): Your department (e.g., “IT Department”, “Web Services”).
- City/Locality (L): The city where your organization is legally based (no abbreviations).
- State/Province (S): The state or province (no abbreviations).
- Country/Region (C): The two-letter ISO country code (e.g., US, GB, DE, CA).
Step-by-Step CSR Generation in IIS:
- Open IIS Manager: Press
Win + R
, typeinetmgr
, press Enter, or find via Server Manager > Tools. - Select Server: In the Connections pane (left), click on your server’s name.
- Open Server Certificates: In the center pane (server Features View), double-click Server Certificates.
- Launch Wizard: In the Actions pane (right), click Create Certificate Request….
- Enter DN Properties: Fill in the DN information you gathered meticulously. Pay close attention to the Common Name. Click Next.
- Set Cryptographic Properties:
- Leave Cryptographic service provider as Microsoft RSA SChannel Cryptographic Provider.
- Choose Bit length: 2048 or higher (2048 is the current standard). ^^[NIST SP 800-57 Part 1 Rev. 5 recommends minimum 2048-bit RSA through 2030]^^
- Click Next.
- Save the CSR File: Click the
...
button, choose a location (e.g.,C:\Certificates
), name your file (e.g.,yourdomain_com_csr.txt
), and click Open, then Finish.
What You Have Now:
- A text file (
.txt
or.req
) containing the CSR code block (from-----BEGIN...
to-----END...
). - A hidden private key securely stored on the server, linked to a pending request in IIS Server Certificates.
- Action: Copy the entire CSR text block and submit it to your chosen Certificate Authority (like SSLRepo) when purchasing your SSL certificate.
Part 2: Enable HTTPS on IIS (After Receiving Your Certificate)
Once the CA validates your request and issues the certificate, you’ll receive the certificate files (commonly a .p7b
file for IIS, or individual .crt
/.cer
files). Now you can install it and turn on HTTPS.
Step 1: Install the SSL Certificate in IIS
- Download Certificate: Obtain the certificate file(s) from your CA via email or their portal. Download/transfer them to your IIS server. A
.p7b
file is often easiest for IIS. - Open IIS Manager and navigate back to Server Certificates (as in Part 1, steps 1-3).
- Complete Request: In the Actions pane, click Complete Certificate Request….
- Specify Certificate File: In the wizard:
- Click the
...
button and browse to the certificate file you downloaded from the CA (e.g.,yourdomain_com.p7b
oryourdomain_com.crt
). - Friendly name: Enter a descriptive name to easily identify this certificate later (e.g.,
yourdomain.com_SSL_2025
or the domain name itself). - Select certificate store: Choose Personal (usually default and correct for web hosting certificates).
- Click OK.
- Click the
- Verify Installation: The certificate should now appear in the list under Server Certificates, showing the Friendly Name you provided, the expiration date, etc. If you used separate
.crt
files and encounter trust issues later, you might need to manually import the Intermediate CA certificates into the “Intermediate Certification Authorities” store using MMC. The P7B file usually handles this automatically.
Step 2: Configure Site Bindings for HTTPS
- Navigate to Your Site: In the Connections pane of IIS Manager, expand the Sites folder and click on the specific website you want to secure.
- Open Bindings: In the Actions pane (right), click Bindings….
- Add HTTPS Binding: In the Site Bindings window, click Add….
- Configure Binding Details:
- Type: Select https from the dropdown.
- IP address: Choose All Unassigned unless you need to bind to a specific IP address on the server.
- Port: Enter 443 (the standard port for HTTPS).
- Host name: (Optional but Recommended for SNI) Enter the hostname that matches the certificate’s Common Name (e.g.,
www.yourdomain.com
). This allows hosting multiple SSL sites on the same IP address using Server Name Indication (SNI). ^^[SNI is supported by virtually all modern browsers and servers, enabling efficient use of IP addresses]^^ - SSL certificate: Select the certificate you just installed using its Friendly Name from the dropdown list.
- Click OK.
- Close Bindings Window: Click Close.
Step 3: Test and Verify
- Firewall Check: Ensure that port 443 is open on any firewalls (Windows Firewall, network firewalls) allowing inbound traffic to your web server.
- Browser Test: Open a web browser and navigate to your site using
https://yourdomain.com
.- Look for the padlock icon in the address bar.
- Click the padlock to view certificate details and verify it’s the correct one and trusted.
- External Tools: Use an online SSL checker tool (like Qualys SSL Labs) to perform a deep analysis of your HTTPS configuration, checking for chain issues, protocol support, and vulnerabilities.
Best Practices
- Accuracy: Double-check all information during CSR generation.
- Backup: After successful installation, export the certificate with its private key from IIS (as a password-protected
.pfx
file) and store it securely as a backup. - Redirection: Implement an HTTP-to-HTTPS redirect (usually via URL Rewrite module in IIS) to ensure all visitors use the secure connection.
- Renewal: Keep track of the certificate expiration date and start the renewal process (which involves generating a new CSR) well in advance.
Wrapping It Up
Successfully moving your IIS website to HTTPS involves accurately using Windows tools to Generate CSR on Windows, obtaining the certificate, and then configuring IIS correctly to enable HTTPS on IIS. By completing the certificate request and adding the HTTPS binding, you activate the secure layer, protecting data and building user confidence.
Need your SSL certificate after generating the CSR? Visit SSLRepo for a wide range of trusted certificate options.
Frequently Asked Questions (FAQ)
Q1: Can I generate the CSR on one Windows machine and install the certificate on a different IIS server?
A: No. The private key is generated and stored only on the machine where you run the “Create Certificate Request…” wizard in IIS. You must install the corresponding certificate on that same server using “Complete Certificate Request…”. For multiple servers (like a load-balanced farm), you typically install on one, then export the certificate with its private key as a PFX file, and import that PFX onto the other servers.
Q2: I completed the certificate request, but the certificate doesn’t show up in the Server Certificates list?
A: This usually means the downloaded certificate didn’t match the pending private key (perhaps the wrong CSR was used, or the pending request was accidentally deleted) or there was an issue importing the chain. Try re-downloading the cert (ensure it’s the right one) and completing the request again. If using .crt
files, ensure intermediates are installed. If the pending request is gone, you’ll need to generate a new CSR and reissue the certificate.
Q3: What is the difference between the ‘Personal’ and ‘Web Hosting’ certificate stores in IIS?
A: For most typical SSL certificates used directly with website bindings in IIS, the Personal store is the correct and standard choice during the “Complete Certificate Request” process. The “Web Hosting” store is a newer store optimized for scalability in environments hosting a very large number of SSL sites, but ‘Personal’ works universally for standard setups.
Q4: Do I need to restart IIS after enabling HTTPS binding?
A: Usually, adding or modifying bindings in IIS takes effect immediately without requiring a full IIS restart (or iisreset
). However, if you encounter issues, a restart of the specific website or the W3SVC service can sometimes help apply changes cleanly.
Q5: HTTPS is enabled, but browsers show a security warning?
A: This could be due to several reasons:
* Common Name Mismatch: The URL you typed doesn’t match the CN on the certificate.
* Expired Certificate: The certificate has passed its validity date.
* Incomplete Chain: Intermediate CA certificates are missing or not installed correctly (less common if using P7B). Use an SSL checker tool to diagnose.
* Mixed Content: The HTML page is loading resources (images, scripts) over insecure HTTP. Fix code to use HTTPS for all resources.