调试时的Visual Studio网站HTTP重定向到https [英] Visual Studio website is redirecting http to https when debugging

查看:1075
本文介绍了调试时的Visual Studio网站HTTP重定向到https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有IIS前preSS或Visual Studio 2013的一个问题。

I am having an issue with IIS express or Visual Studio 2013.

该站点没有HTTPS或SSL在属性中启用或设置。

The site has NO https or ssl enabled or setup in the properties.

当我点击调试,该网站在broswer启动并尝试加载:
 的http://本地主机:61488 / Default.aspx的

When I click debug, the site launches in the broswer and tries to load: http://localhost:61488/Default.aspx

它,然后因为某些原因被自动重定向到:
https://开头本地主机:61488 / Default.aspx的
我然后得到一个错误code:ERR_SSL_PROTOCOL_ERROR

it then for some reason gets automatically redirected to: https://localhost:61488/Default.aspx and I then get an Error code: ERR_SSL_PROTOCOL_ERROR in chrome

我不是很确定该怎么做?

Im not quite sure what to do?

推荐答案

我相信这是由HSTS引起的 - 见<一href=\"http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security\">http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security

I believe this is caused by HSTS - see http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security

如果你(开发),它发送一个头HSTS任何其他本地主机网站...

If you have (developed) any other localhost sites which send a HSTS header...

如。严格-运输和安全性:最大年龄= 31536000; includeSubDomains; preLOAD

eg. Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

...然后根据最大年龄的值,将被要求未来主机请求必须通过HTTPS提供。

...then depending on the value of max-age, future requests to localhost will be required to be served over HTTPS.

要解决这个问题,我做了以下。

To get around this, I did the following.


  • 在浏览器地址栏中输入铬://净内部/#HSTS

  • 在页面的底部在查询域名文本框 - 验证本地主机是众所周知的浏览器

  • 如果是这样,使用以上文本框中删除本地主机域

  • 您的网站现在应该使用老式HTTP工作

这是不是一个永久性的解决方案,但至少会得到它的项目之间的合作。如果有人知道如何永久地从HSTS列表中排除本地主机,请让我知道:)

This is not a permanent solution, but will at least get it working between projects. If anyone knows how to permanently exclude localhost from the HSTS list please let me know :)

这篇关于调试时的Visual Studio网站HTTP重定向到https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆