Free SSL certificate for your website hosted on IIS

SSL is the basic requirement for a website these days. It affects your site’s credibility if your site is not secure and your visitors are noticing that “Not secure” tag right in the address bar when they visit your site.
SSL certificate is also important to make sure your site’s content is browsed securely and is prevented from middle man attacks and other risks I am not aware of.
So how can we implement SSL for free on a site hosted on IIS? When I googled this subject, I found some sites that provide SSL for free. The only thing was I had to sign up on the site and create an account and create a free SSL certificate for myself. The only problem with this is that over the years I have signed up on too many platforms and I tend to forget passwords and even the platforms entirely.
Luckily, I found another easier way to install free SSL on IIS. It is a windows console command like utility called win-acme. You can download it from their github release page –
https://github.com/win-acme/win-acme/releases
Under the assets section, look for the one that ends with .x64.trimmed.zip. The latest at the time of this blog is win-acme.v2.1.20.1185.x64.trimmed.zip
Download and extract the contents of this zip into a folder. Open Command Prompt as Administrator.
Change your current working directory to the folder where you extracted the zip and run this command –
wacs.exe
This should start a wizard –
Type N and hit enter. It should show a list of sites hosted on your IIS –
Enter the number of the site you want to create SSL for and hit enter –
Enter A and hit enter –
And that should be it. Your site is hosted on SSL. You can check by visiting your site and making sure the site shows a lock icon in the address bar –
P.S
This solution only works for sites that have been configured with host bindings. So you should have a domain name registered with some provider. Then you should have a CNAME entry under that domain that points to the IP address of your machine where IIS is installed. And finally you should have host name populated with the domain name under Bindings of your site.
If you are new to IIS, you may have to do few more things in configuration to make sure your site is redirecting to https if users try to access it on http. You can simple copy following block inside your web.config under System.WebServer tag –
Make sure you have urlrewrite plugin installed in your IIS before you add this tag to web.config though. You can download it from IIS official site - https://www.iis.net/downloads/microsoft/url-rewrite
Conclusion
In this blog, I have tried to offer simplest way to install SSL certificate on a website that is hosted on IIS. I hope you liked this blog and in case you faced any issues, I would love to help. I can be reached at naveenraina@outlook.com