当您最初设置IIS Express以启用SSL时,它默认将端口设置为44300。不幸的是,当我尝试在
链接是使用以下内容生成的:
虽然不太优雅,
https://localhost/
上访问我的网站时,除非我使用端口号44300- https://localhost:44300/
,否则它无法工作。链接是使用以下内容生成的:
<%= Html.ActionLink("Index", "Index", "Home", new { @action = "https://" + Request.Hostname + Url.Action("Index", "Home") }) %>
虽然不太优雅,
@action
关键字可以覆盖生成的路由,但这意味着应用程序似乎需要知道任何非标准端口(例如 44300)。
问题在于,我要编写的东西只解决在开发环境中才会出现的问题。
所以我的问题是... 如何将端口更改为 443 并使 IIS Express 喜欢它?
我的站点配置如下:
<site name="MySite" id="2" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="C:\Inetpub\MySite" />
</application>
<bindings>
<binding protocol="http" bindingInformation=":80:" />
<binding protocol="https" bindingInformation=":44300:" />
</bindings>
</site>
非常感谢您提前的帮助。
更新:
这个问题已经被IIS论坛上的Divya回答了。
netsh http show sslcert
返回了100多个条目,而44300位于顶部。因此,使用命令netsh http show sslcert | more
或netsh http show sslcert > output.txt
可以让您更轻松地处理事情。 - rymonetsh http show sslcert ipport=0.0.0.0:44300
这个命令,该命令将过滤到特定的内容。 - Alphanetsh http show sslcert | clip
命令将结果复制到剪贴板,然后粘贴到文本编辑器中进行搜索。 - Mariusz Pawelski