IIS Express self signed certificates.

  • Thread starter Thread starter e-cyprus
  • Start date Start date
E

e-cyprus

Guest
Hi, I am making a web application and it needs to run under SSL.

For that reason I have switched in Visual Studio the option SSL Enabled.


b0b858e6-308b-4c84-b678-3f0dcd3c1b7c?upload=true.png

Once I did that I got the following dialog box asking me if I want a self-signed certificate by IIS Express

f1093f44-b913-449a-a2f6-3263caaba05a?upload=true.png



I replied with Yes and IIS Express generated a self-signed certificate that it has been added in my personal certificates, i have moved the certificate to Trusted Root Certificates as shown below

3e858002-a1d9-435a-8199-ff61a8bce0db?upload=true.png



Once I did that everything worked as expected !!!
I have to mention that at the time I have runned the following code : netsh http show sslcert


and I have seen that IIS Express made bindings to the ports 44300 until 44399

below are partially shown the results of my query

e0cd9306-fd55-44f8-9eb0-4b5496ed4abf?upload=true.png
Now the fun part starts, suddenly my pc shut down from kernel 41 error (probably a problem with my PSU (this is another story :) ))
when the computer restarts I try to use the SSLURL but I get the following error: ERROR_CONNECTION_RESET - the site does not even loads.




Therefore, I re-run the command: netsh http show sslcert

this time I only got one binding as shown below :



af6315e6-2344-4c29-ac51-601b2ee75d54?upload=true.png



Since my SSL website has a binding on a port between 44300 - 44399 the above binding is useless therefore i think I found why my SSLURL is not showing up.


Moving forward, I have decided that I have to manually bind the previously generated SSL certificate to the port that my website uses for this example lets say port 44314.



therefore I use the following command from CLI: netsh http delete sslcert ipport=0.0.0.0:44314

Once deleted the entry succesfully I tried to make a new binding using the following command :

netsh http add sslcert ipport=0.0.0.0:44314 certhash=7d5ca4a11949712b0a24685a13066f9c29c9c9ef appid={214124cd-d05b-4309-9af9-9caa44b2b74a}


Certhash and Appid are the ones' used before by IIS Express for my certificate.



I received the following error:

SSL Certificate add failed,Error:1312
A specified logon session does not exist. It may already have been terminated.


I don't know how to move forward and I need my site to run on SSL (in the development environment). I have disabled and re-enable the SSL Option from the visual studio hoping to get again the message shown in the second picture of this post. Unfortunately IIS had never asked me again for a new self-signed certificate.


Ps: I have tried to repair IIS in an effort to recreate the bindings but that has not helped either.




Any advice ?






Continue reading...
 
Back
Top