我试图遵循这篇文章中的说明:http://www.codeproject.com/Tips/766918/Visual-Studio-Use-HTTPS-SSL-On-Web-Application-Pro。没有提示我“要信任IIS SSL证书吗?”
证书存储区中没有出现证书,如下所示:

请问我做错什么了?在Visual中启动应用程序时,请查看我从IE和Firefox获得的警告:在中启用SSL
发布于 2016-08-28 13:42:09
将IIS配置为使用SSL由多个步骤组成,在第一次使用时有些棘手。必须做的最重要的部分如下:
MakeCert.exe生成自签名证书。查看%ProgramFiles(x86)%\Windows Kits\10\bin\x64或%ProgramFiles(x86)%\Windows Kits\8.1\bin\x64的MakeCert.exe实用程序。证书还必须导入“受信任的根证书颁发机构”或“第三方根证书颁发机构”,才能使其在本地计算机(或本地用户)上受信任。netsh http add sslcert ...和netsh http add urlacl ...,或者使用带有setupFriendlyHostnameUrl参数的"%ProgramFiles%\IIS Express\IisExpressAdminCmd.exe"实用程序。<binding>问题的网站应该包括在%USERPROFILE%\Documents\IISExpress\config\applicationhost.config中。如果只在Visual内部使用inserted,则Visual将在$(solutionDir)\.vs\config\applicationhost.config文件中插入相应的绑定。我建议你阅读并关注汉瑟曼2011年发布的那篇旧文章。这些信息至今仍是有罪的。
发布于 2016-08-28 11:57:36
我通过以下步骤取得了一些进展:
1) Click on the project name then F4 or View -> Properties Window
2) Set SSL Enabled to: True
3) Make a note of the SSL URL that is generated. In my case it is: https://localhost:44334/
4) Right click on the project name and select: Properties
5) Set Project URL to the URL noted in step 3 i.e. https://localhost:44334/
6) Open up a command prompt and run: "C:\Program Files (x86)\Windows Kits\8.1\bin\x64\makecert.exe" -r -pe -n "CN=localhost" -b 01/01/2000 -e 01/01/2036 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12.
7) Go to mmc.exe and get the thumbprint of the certificate
8) Run the following from a command line: netsh http add sslcert ipport=0.0.0.0:44334 appid={214124cd-d05b-4309-9af9-9caa44b2b74a} certhash=2f11d025f2bc8802b45ceb7e03632eec333bc1ff. 2f11d025f2bc8802b45ceb7e03632eec333bc1ff is the thumbprint from step 8 and 44334 is the port from step 3.
9) Run: netsh http add urlacl url=https://localhost:44334/ user=Everyone
10) Launch the web app and I see this (
which looks a lot better):

11)转到MMC,找到“个人”证书,然后将其移动到:受信任的根证书颁发机构。
那就成功了。
上面描述的所有步骤都可以在本文中找到:http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx。我已经总结了我遵循的步骤,以防我(或其他人)将来想要引用它--这篇文章相当长。请注意,在我的示例中: applicationhost.config是由Visual自动写入的,而在链接中,作者建议您手动写入以下文件:我的application.config文件在.vs\config文件夹中找到。
发布于 2021-07-04 07:00:12
只需修复您的visual studio以重新生成IIS Express开发证书。
https://stackoverflow.com/questions/39189755
复制相似问题