Search code examples
sslcertificatessl-certificateiis-expressself-signed

Create a Self-Signed Certificate within IIS Express


From my understanding it is in fact possible to create a certificate issued to an IP address. Is it possible to do so within IIS Express?

Please note that this is for testing only.

Edit

People seem to be missing the real meat and potatoes of my question so I have removed the extra details.


Solution

  • Thank you @Bruno for all your suggestions!! Using a separate tool to create the SSL certificate got me going in the right direction.

    First I tried the IIS 6 selfssl command-line tool which likely would have worked as well for step one of getting this to work (but I have not tested it after finding my current solution). The first step is creating the certificate and the second step is to bind that certificate to my IP/Port.

    1. I used makecert from the Visual Studio Command Prompt to create my cert (this is where I think that the IIS 6 selfssl tool from the IIS 6 Resource Kit should work as well). After creating the certificate I found it under Personal/Certificates using the mmc snap-in console and adding the Certificates snap-in.

      makecert -r -pe -n "CN=0.0.0.0" -b 01/01/2011 -e 01/01/2025 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12

    2. To bind the cert to my IP/Port I used netsh. ipport should be changed to your IP/Port. appid is a GUID and I don't believe that this matters what you set it to. certhash you can get from the Thumbnail field on the certificate itself but you must remove the spaces in the hash.

      netsh http add sslcert ipport=0.0.0.0:44300 appid={AnyGuid} certhash=YourCertificateThumbprint