Friday, September 12, 2008

Create and Install SSL Certificate in IIS


You have created an application say for example a web service and want to secure it but wondering how to create and install SSL certificate in order to test it?, then do not worry; just read this article :)
So before proceeding, let’s make sure you have Internet Information Services (IIS) 6.0 Resource Kit Tools installed on your machine.


You can download this from here: http://www.microsoft.com/downloads/details.aspx?familyid=56FC92EE-A71A-4C73-B628-ADE629C89499&displaylang=en Size: 5.8 MB.


Once you finish downloading, install it. Now go to Start menu and look for “IIS Resources” and under this, look for “Self SSL”. Run the exe (which looks similar to command prompt).

The syntax of the command is:

SelfSSL [/T] [/N:CN] [/K:key Size] [/S:site id] [/P:port]

Now type the following command:
selfssl.exe /T /N:CN="your machine name" /K:1024 /V:7 /S:1 /P:443

Just specify your machine’s name. You can also change the parameters if required.
Meaning of these parameters is as follows:

/T Adds the self-signed certificate to "Trusted Certificates" list. The local browser will trust the self-signed certificate if this flag is specified.

/N:CN Specifies the common name of the certificate. The computer name is used if not specified.

/K:key size Specifies the key length. Default is 1024.

/V:validity days Specifies the validity of the certificate. Default is 7 days.

/S:site id Specifies the id of the site. Default is 1 (Default site).

/P:port specifies the SSL port. Default is 443.

You can verify your newly installed certificate from IIS. It will look similar to the one shown above.

Oh! yea, please do not forget to leave a comment on this post.


No comments:

Post a Comment