win-acme is a free, open-source tool that gets certificates from Let's Encrypt, adds them to IIS and renews them automatically. In about ten minutes your IIS site can serve HTTPS.
Before you start
- IIS is installed and your site has an http binding with a host name, for example
www.example.com. See Install IIS and host a website. - The domain's DNS A record already points to this server.
- Port 80 is reachable from the internet. Let's Encrypt checks it to confirm you control the domain. Port 443 must be open too for HTTPS visitors.
1. Download win-acme
- On the server, go to the official site, win-acme.com, and download the latest release for your system (the x64 "pluggable" or "trimmed" zip).
- Extract it to a permanent folder, for example
C:\Tools\win-acme. The renewal task runs from here, so do not delete it later.
2. Request the certificate
- Open
C:\Tools\win-acmeand run wacs.exe as Administrator. - Choose N: Create certificate (default settings).
- Choose your IIS site from the list, then select the host names to include (or press Enter for all of them).
- Enter an email address for expiry warnings and accept the Let's Encrypt terms when prompted.
win-acme validates the domain, installs the certificate, adds an https binding on port 443 to your site and creates a scheduled task that renews the certificate before it expires.
3. Check it
Open https://www.example.com from your own computer. The browser should show a padlock. Confirm the renewal task exists:
Get-ScheduledTask | Where-Object TaskName -like "win-acme*"4. Redirect HTTP to HTTPS (optional)
Install Microsoft's URL Rewrite module for IIS, then add this inside <system.webServer> in your site's web.config:
<rewrite>
<rules>
<rule name="To HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions><add input="{HTTPS}" pattern="off" /></conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>Warning: Keep port 80 open even after you redirect. Renewals use it, and closing it makes the certificate expire after its validity period.
Troubleshooting
- Validation failed: check that DNS points to this server (
nslookup www.example.com), that port 80 is allowed in the firewall, and that the http binding uses exactly that host name. - Rate limit messages: Let's Encrypt limits repeated failed attempts. Fix the cause, wait an hour and try again.
- Certificate did not renew: run
wacs.exeand choose the option to run renewals manually to see the error.
