This blog post is about a small tool I just finished. It makes configuring and using SSL much easier. In the first part of the blog post I quickly review the problems and difficulties you run into when setting up SSL. Then I introduce SELFSSL7 and finally walk through several usage scenarios.
I'm sometimes amazed how hard seemingly simple things still are. Take SSL as an example. Shouldn't setting up SSL be easier than what's shown in the walkthrough on how to set up SSL in IIS7. Here are the typical steps you have to go through before you can access your SSL site.
Once you've completed all of these steps you are able to use the magic "https" prefix to browse to your web-site. There are all kinds of things that can go wrong during these steps not to talk about the time it takes until you finally have SSL working. It's certainly a royal pain if you want to do that on your local dev box.
IIS7 made it much easier by allowing you to create a self-signed certificate and use this certificate for your SSL site. But there are still issues, for example TRUST.
As soon as you are using self-signed certificates Internet Explorer will complain that it doesn't trust the certificate:
Firefox will do the same:
When a web browser like Firefox or Internet Explorer receive a SSL certificate from the server it usually checks the certificate for the following three things:
Checking for #1 and #2 are pretty straightforward. For #1 the browser simply compares the current date with the expiration date of the certificate. The browser complains if the current date is already past the expiration date of the certificate. Checking #2 is easy, too. Compare the address entered in the address bar with the "common name" property in the certificate. If the name doesn't match the browser will complain. Checking for trust is a bit trickier. All browsers have a list of baked-in certificates (Trusted Root Certificates). The browser will complain if the SSL certificate IIS sends you is not a descendant from one of these Trusted Root Certificates. Here is the list of Trusted Root Certificate Authorities" that Internet Explorer uses ("Tools" - "Internet Options" - "Content" - "Certificates" - select the "Trusted Root Certification Authorities" tab).
IIS7 introduced a new feature which allows you to create a self-signed certificate that can be used for SSL. Problem is that it is a bit limited in what you can do with it.
SelfSSL.exe was a tool that we shipped as part of the IIS6 Resource Kit. By simply executing it you got the full monty:
SelfSSL still works if you have "IIS6 Management Compatibility". It was time however to rewrite this tool for IIS7 and to add some features to it.
SelfSSL7 creates self-signed certificates with
SelfSSL7 also allows you to add a SSL bindings in IIS. Configurable are
When the /T parameter is specified the self-signed certificate is added to the "Trusted Root Certificate Authorities" of the current user which will make the certificate trusted and Internet Explorer won't complain anymore.
And best of all: SelfSSL7 has intelligent defaults, i.e. you only have to enter SELFSSL7.EXE and it will do the work for you to set up a fully functioning SSL for your local IIS7 machine.
SelfSSL7 can also export the self-signed certificate to a password protected PFX file. This allows you to import the certificate on another machine which then can also trust the self-signed certificate.
With SelfSSL7.exe it becomes extremely simple to set up a SSL site. There are several command-line options that allow you to customize the SSL experience. However, due to the smart defaults you are able to run SELFSSL7.EXE without any parameters and get a fully functioning SSL site.
Trackback: