[英]IIS Express http/https bindings not working correctly
I have a solution with 6 projects in it. 我有一个包含6个项目的解决方案。 And for 2 of them I enabled SSL in project properties.
对于其中两个,我在项目属性中启用了SSL 。 The problem is, that when I start debugging, all my projects starts with https , even if they're not configured to use SSL.
问题是,当我开始调试时,我的所有项目都以https开头,即使未将其配置为使用SSL。
Eg before enabling SSL my project was accessible via http://localhost:63684/
. 例如,在启用SSL之前,可以通过
http://localhost:63684/
访问我的项目。 Now, with https enabled I can access my project under https://localhost:43000/
, but when I try to access this url: http://localhost:63684/
, it automatically changes to https://localhost:63684/
and I get the following error in the browser: 现在,启用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.
The same goes for the projects, which doesn't have SSL enabled and I can't access them. 对于没有启用SSL的项目,我也无法访问它们。
...\\Documents\\IISExpress\\config\\applicationhost.config
file has proper bindings: ...\\Documents\\IISExpress\\config\\applicationhost.config
文件具有正确的绑定:
<bindings>
<binding protocol="http" bindingInformation="*:63684:localhost" />
<binding protocol="https" bindingInformation="*:44300:localhost" />
</bindings>
And other 4 projects, which doesn't have SSL enabled, but are still automatically switched to https: 其他4个项目未启用SSL,但仍会自动切换到https:
<bindings>
<binding protocol="http" bindingInformation="*:11483:localhost" />
</bindings>
I already tried to delete IISExpress folder, because I thought config is broken somehow, but it didn't help. 我已经尝试删除IISExpress文件夹,因为我认为config以某种方式被破坏了,但是并没有帮助。
Any ideas what causes automatically switching to https and how to fix it? 有什么想法会导致自动切换到https,以及如何解决它?
BTW, I was following this article when implementing https in my 2 projects and my goal is to be able to use http when debugging locally and https when project is published to the web. 顺便说一句,我下面这个在我的2个项目实现HTTPS时,我的目标是当项目发布到网上本地和https调试时要能使用http的文章。
Turns out, that it was a Chrome problem, because I noticed, that on other browsers everything is working well. 原来,这是一个Chrome问题,因为我注意到,在其他浏览器上,一切工作正常。 This SO answer helped me to fix this issue.
这样的答案帮助我解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.