Wednesday, June 17, 2009

Self signing your server for SSL

I’ve been playing around with WCF and one of the problem areas is that our secure servers use a reverse-proxy configuration to route requests for web services.  This is all fine for old web services; however WCF is a little more particular with it’s requirements.  The reason for this is that the SSL Certificate does not actually exist on the Secure Server, it exists on the Proxy server, therefore when WCF starts it brings up the error saying “SSL is not supported”.  To resolve this we need to provide the server with a mock certificate using the same domain name as that used by the Proxy server.

To create a local mock SSL certificate for your development machine is quite easy and is also very useful to have if you are doing testing.

Installation

  1. Download the Internet Information Services (IIS) 6.0 Resource Kit Tools from the Microsoft site.
  2. Run the installation  image

         image

3.  Choose a complete install and follow all the instructions until it’s finished.

4.  Now you go to your Start/Programs/IIS Resources/SelfSSL/SelfSSL.

      image

5.   You need to work out your Site ID and the easiest way to get this is to use IIS Admin right click the website properties and go to Logging properties in the website Tab and look at the Log File name below the Site ID is “1”.

       image

6.   Enter the command “SELFSSL.EXE /S:1” and confirm “Y”.

      image

7.   Your site is now activated to use SSL.

     image