
Setting up SSL for Windows
Service workers are designed to run only across HTTPS, so in order for us to test our code, we need our web pages to be delivered across HTTPS. In this recipe, we will cover getting your site setup with SSL support for Windows.
Getting ready
This recipe assumes you run Windows 7 or higher with Internet Information Service (IIS) enabled.
How to do it...
Follow these instructions to enable SSL:
- First, open IIS; you can do this by running the following command inside the command line:
Inetmgr
- Select the server node in the tree view and double-click the Server Certificates feature in the list view, as shown:
- Click on the Create Self-Signed Certificate... link in the Actions pane.
- Enter a meaningful name for the new certificate and click OK.
This will generate a self-signed certificate, which is marked for Server Authentication use, meaning it uses a server-side certificate for authenticating the identity of the server and also for HTTP SSL encryption.
In order to create an SSL binding, we have to select a site in the tree view and then, in the Actions pane, click Bindings.... This will bring up the bindings editor that manages bindings for your website, which include create, edit, and delete. Now, to add your new SSL binding to the site, click Add....
- Port 80 is the default setting for a new binding for HTTP. We can select https in the Type drop-down list. Select the self-signed certificate we created in the previous section from the SSL Certificate drop-down list, and then click OK.
- Now we have a new SSL binding on our site and all that remains is to make sure that it works.
- Click Continue to this website to proceed.