IIS7 supports creating self-signed certificates. This is done from the root web server folder, under the "Server Certificates" icon. The feature works well as long as you are using your computer’s name as the domain name of the web site, e.g. http://mycomputer/.
A problem arises if you want to use a different domain name for your development and testing purposes. I have created additional local DNS mappings in the C:\Windows\System32\Drivers\etc\hosts file, such as "127.0.0.1 dev.langlo.no". When I try to go to a page using this domain and the HTTPS protocol (e.g. https://dev.langlo.no/login.aspx), I get a warning that the certificate is for a different domain (the local computer name domain). It’s possible to get past the warning and use the SSL tunnel on the site, but if you are running a web application under partial trust (for instance a WPF XBAP), then this warning causes your application to refuse to accept the SSL connection.
The solution to this problem is to create a self-signed certificate that is issued to your specific domain (e.g. dev.langlo.no). Unfortunately I don’t know how to do this from within the IIS Manager UI.
After many hours of research today I finally found out how to this. Here’s the solution
Open a Visual Studio command prompt (has yellow font color on my machine) and run the following two commands (note, you have to "Run As Administrator"):
makecert.exe -n "CN=Koda Root CA,O=Koda Software,OU=R&D,L=Salt Lake City,S=UT,C=US" -pe -ss Root -sr LocalMachine -sky exchange -m 96 -a sha1 -len 2048 -r
makecert.exe -n "CN=dev.langlo.no" -pe -ss My -sr LocalMachine -sky exchange -m 96 -in "Koda Root CA" -is Root -ir LocalMachine -a sha1 -eku 1.3.6.1.5.5.7.3.1
You want of course to replace my identifiers with yours:
"Koda Root CA" – this is the name of your Root Certificate Authority
"O=Koda Software,OU=R&D,L=Salt Lake City,S=UT,C=US" – company data, optional
"dev.langlo.no" – this the domain you need the SSL protocol to run within
Just for completeness sake, I’m running Windows Vista Ultimate, SP1 and Visual Studio 2008 Professional.
Hope this helps!
