I cannot force IIS Express to accept secure connections for the VS2010 MVC3 project that I am developing. I can force it to accept insecure connections on port 80, but not protect them on port 443.
I have taken the following steps based on googling:
1) Print the SHA1 fingerprint for my self-signed IIS Express Server certificate by running the following on the VS2010 command line:
certmgr.exe /c /s /r localMachine MY
The result is 9B088F80 A4FC3141 28F62890 70BA1FC4 49FDD009. Later, I found out that I needed to remove spaces when using the fingerprint.
2) Removed any certificate associated with port 443 by executing the following in an elevated command prompt request:
netsh http delete sslcert ipport=0.0.0.0:443
3) Generated a new GUID by running Create GUID from the Tools VS2010 menu. In my case, I received B0421A5B-FF61-47CE-892D-11AA3A9C7D2A.
4) Installed a self-signed certificate on port 443 by executing the following in a request of an elevated command line:
netsh http add sslcert ipport=0.0.0.0:443 certhash=9B088F80A4FC314128F6289070BA1FC449FDD009 appid={B0421A5B-FF61-47CE-892D-11AA3A9C7D2A}
5) Modified the ACL by running the following from an elevated command prompt:
netsh http add urlacl url=https:
6) Changed the application.config file for IIS Express by adding a binding for port 443 and the https protocol. The sites section for the file is as follows:
<sites> <site name="Development Web Site" id="1" serverAutoStart="true"> <application path="/"> <virtualDirectory path="/" physicalPath="%IIS_BIN%\AppServer\empty_wwwroot" /> </application> <bindings> <binding protocol="https" bindingInformation="*:443:localhost" /> <binding protocol="http" bindingInformation="*:80:localhost" /> </bindings> </site> <siteDefaults> <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" /> <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" /> </siteDefaults> <applicationDefaults applicationPool="IISExpressAppPool" /> <virtualDirectoryDefaults allowSubDirConfig="true" /> </sites>
7) Restart the http service by running the following command at a command prompt with an elevated command prompt:
net stop http net start http
8) The project URL on the Internet tab of my MVC project properties page has been changed to the following:
http:
Saving the project property page caused server reconfiguration after I made this change.
When I run the MVC application from VS2010, it binds correctly to http: // localhost (by default, port 80, I did not turn on all the steps so that IIS Express works with insecure / normal connections on port 80, but they are essentially run from 5 to 7, but with an emphasis on http and port 80, not https and port 443).
However, when I try to switch to any action that requires https, I get a "server rejection" error message.
What am I doing wrong?