This article will demonstrate how to in IIS perform an SSL certificate renewal. The CA used in this article is on the same domain as the IIS server.
Install IIS on Windows
If not already installed, enable Internet Information Services (IIS) on Windows 10 or Windows 11 or a Windows server.
- Open the Start menu
- Type features and select Turn Windows features on or off
- Select the Internet Information Services checkbox and then click OK
- Wait for the installation to complete.
Manually request a certificate
To manually request an SSL certificate from a Certification Authority (CA), run this command.
certreq -submit -attrib "CertificateTemplate:PrivateWebServer" C:\Users\<user>\csr.pemWhere CertificateTemplate:PrivateWebServer is the name of the certificate template configured in the Microsoft CA you are requesting a certificate for and C:\Users\<user>\csr.pem is the path to the already generated CSR. For instructions on how to generate a CSR click here.
Microsoft CA for web server SSL certificates
Ensure permissions are correct on the certificate template.
Make sure correct CA role is installed for web requests. Read this article for more information.
Troubleshooting
If you encounter the error Certificate not issued (Denied) Denied by Policy Module The DNS name is
unavailable and cannot be added to the Subject Alternate name. 0x8009480f
Certificate Request Processor: The DNS name is unavailable and cannot be
added to the Subject Alternate name. 0x8009480f (-2146875377)
Denied by Policy Module when requesting a certificate then follow these steps.
In your Certificate Templates console:
- Double click your template
- Navigate to the Subject Name tab
- Click the Supply in the request radio button
- Check the Use subject information from existing certificates for autoenrollment renewal requests checkbox
- Re-submit your certificate request
Automatic Certificate Enrollment in IIS
You can use group policy to configure automatic SSL certificate enrollment. On a domain controller open the Group Policy Management console.
- Right click the domain or OU where you want to create the group policy
- Click the Create a GPO in this domain, and Link it here… option
- Give it a name and click OK
- Right click the new GPO and click Edit
- Navigate to Computer Configuration > Policies > Windows Settings > Security Settings > Public Key Policies. You should see the Certificate Services Client – Auto-Enrollment policy.
- Enable the policy, renew expired certificates, and Update certificates in the properties.
Next we will create a Certificate Request Setting.
- Expand the Public Keys Policies folder
- Right click the Automatic Certificate Request Settings
- Select New > Automatic Certificate Request
- Click Next to skip the Welcome screen
- Select the template you are using for web server SSL certificates and click Next
IIS certificates should now be ready for auto renewal. This article goes into more depth.
On your certificate template on the Security tab make sure Autoenroll is selected for the right user. The answer in this forum goes into more depth on setting the right permissions.
In IIS, you should then enable IIS rebind.
- Open Internet Information Services (IIS) Manager
- In Connections, select the server
- In Home > IIS, double click Server Certificates
- In Actions click Enable Automatic Rebind of Renewed Certificate
Restart the certsvc service with this command.
net stop certsvc
net start certsvcPowershell certificate request
You can use this PowerShell script as a starting point.
Conclusion – IIS SSL Certificate Renewal
This article has demonstrated how to request and renew certificates using IIS and a private Microsoft CA. Let us know in the comments if you have any questions or need clarification.
Leave a Reply