asp.net - IIS Express http/https 绑定(bind)无法正常工作

标签 asp.net iis ssl https iis-express

我有一个包含 6 个项目的解决方案。对于其中的 2 个,我 enabled SSL在项目属性中。 问题是,当我开始调试时,所有 我的项目都以 https 开头,即使它们没有配置为使用 SSL。

例如在启用 SSL 之前,我的项目可以通过 http://localhost:63684/ 访问。现在,启用 https 后,我可以在 https://localhost:43000/ 下访问我的项目,但是当我尝试访问此 url 时:http://localhost:63684/,它会自动更改为 https://localhost:63684/,我在浏览器中收到以下错误:

SSL connection error

ERR_SSL_PROTOCOL_ERROR

Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.

项目也是如此,没有启用 SSL,我无法访问它们。

...\Documents\IISExpress\config\applicationhost.config 文件具有正确的绑定(bind):

<bindings>
    <binding protocol="http" bindingInformation="*:63684:localhost" />
    <binding protocol="https" bindingInformation="*:44300:localhost" />
</bindings>

还有另外4个项目,没有启用SSL,但仍然自动切换到https:

<bindings>
    <binding protocol="http" bindingInformation="*:11483:localhost" />
</bindings>

我已经尝试删除 IISExpress 文件夹,因为我认为配置以某种方式损坏,但没有帮助。

有什么想法会导致自动切换到 https 以及如何修复它吗?

顺便说一句,我正在关注 this在我的 2 个项目中实现 https 时的文章,我的目标是在本地调试时能够使用 http,在项目发布到 web 时能够使用 https。

最佳答案

事实证明,这是一个 Chrome 问题,因为我注意到,在其他浏览器上一切正常。 This SO answer帮我解决了这个问题。

关于asp.net - IIS Express http/https 绑定(bind)无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34097127/

相关文章:

javascript - 单击行上的 Jquery 数据表将旧数据弹出

c# - 单例运行在 Asp.Net web 应用程序上

android - 授权错误

ssl - AWS 负载均衡器始终将 443 路由到 8443

jquery - 无需 Web 服务即可自动完成?

sql - 如何在 ASP.NET 中连接到 SQL Server Compact 4.0?

security - 如何在 kubernetes 应用程序上获取 ssl?

ssl - F5 负载均衡器后面主站点的子文件夹中站点的 iframe 的混合内容错误

c# - 创建唯一网址时超链接不起作用? C# asp.net

c# - 如何将 IP 地址绑定(bind)到我的 Azure Web 角色,以便远程计算机可以全局访问 Web API?