Jam*_*123 16 .net asp.net iis google-chrome iis-express
我正在运行一个简单的 ASP.net Web 应用程序。运行此程序后,Chrome 显示以下错误。
localhost sent an invalid response.
Try running Windows Network Diagnostics.
ERR_SSL_PROTOCOL_ERROR
Run Code Online (Sandbox Code Playgroud)
但我的应用程序是在 http 上,而不是 https 上。
但 URL 正在加载 https://localhost:54056/
config 也仅指向 http。
<site name="tan-square" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\Users\Myfolder\OneDrive\Downloads\tan-square" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:54056:localhost" />
</bindings>
</site>
Run Code Online (Sandbox Code Playgroud)
我不明白问题出在哪里。为什么用https加载?
Jal*_*hal 29
首先,通过以下详细信息检查您的站点 Web 绑定详细信息:
1)打开visual studio,选择你的项目。
2)右键单击项目并选择属性。
3) 在 Web 选项卡下并检查您的项目 url。
确保您的 web.conifg 文件中没有这样的设置,如下所示:
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Strict-Transport-Security"
value="max-age=16070400; includeSubDomains" />
</customHeaders>
</httpProtocol>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
当浏览器看到这一点时,它会记住,在给定的秒数内,当前域只能通过 HTTPS 联系。以后,如果用户键入 http:// 或省略方案,则默认使用 HTTPS。
清除浏览器缓存。您可以尝试查找原因的另一件事是打开 chrome。在 url 中输入 chrome://net-internals/#hsts 并查询本地主机:
查询显示“localhost”在 HSTS 集中的域列表中。
解决方案是从缓存中删除域。在删除域文本字段中输入“localhost”,然后点击删除。这样做之后,当您再次查询“localhost”时,您将收到“Not found”。
小智 5
只需创建新的虚拟目录:
1-右键单击项目并选择属性。
2-在 Web 选项卡下,通过将 localhost 更改为 http://localhost:48333/ 来更改项目 url。
3-单击创建虚拟目录。
4-确保web.config中没有此内容
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Strict-Transport-Security" value="max-age=16070400; includeSubDomains"/>
</customHeaders>
</httpProtocol>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
20773 次 |
最近记录: |