无法禁用SSL的网站 [英] Unable to disable SSL for website

查看:151
本文介绍了无法禁用SSL的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个网站,它部署到Windows Azure。在开发过程中的地方我启用SSL从项目属性,一切(HTTPS地址)在本地主机和Azure的网站,我部署了我的网站上正常工作。

I created a website and deployed it to Windows Azure. Somewhere during development I enabled SSL from the project properties and everything (https address) was working fine in localhost and on the Azure website where I deployed my site.

现在我的Azure审判到期,我感动我的网站到另一个免费asp.net托管不支持SSL,无需支付它。

Now my Azure trial is expiring and I am moving my website to another free asp.net hosting that does not support SSL without paying for it.

所以我想这是一件容易的事,只要设置启用SSL回假,因为它是在我刚开始发展,一切都很好,但事实并非如此。

So I'm thinking it is going to be easy, just set SSL Enabled back to False as it was when I first started development and everything is fine, but that is not the case.

我的网站拒绝后,我禁用SSL工作。
我的Visual Studio中的IIS防爆preSS设置的图片打开,显示出上有正确的地址的服务器:的http:/ /db.tt/EKTcxPsd

My website refuses to work after I disabled SSL. Picture of my Visual Studio setting with IIS Express opened and showing that there is a server on the right address: http://db.tt/EKTcxPsd

当我启动从Visual Studio网站它开始加载页面本地主机:44300
几秒钟后,我重定向到 https://开头本地主机一个显示网页无法使用的错误。图片: http://db.tt/VntZTpKD

When I launch the site from Visual Studio it starts loading the page localhost:44300. After a few seconds I am redirected to https://localhost that displays a "webpage is not available" error. Picture: http://db.tt/VntZTpKD

我曾尝试删除IISEx preSS文件夹,并重新推出的Visual Studio。重新创建ApplicationHost.config文件具有正确的信息(据我所知)

I have tried deleting the IISExpress folder and relaunching visual studio. The recreated applicationhost.config file has the correct information (as far as I know)

<site name="PrototypeNew-bootstrap3" id="2">
  <application path="/" applicationPool="Clr4IntegratedAppPool">
    <virtualDirectory path="/" physicalPath="E:\path-shortened\Visual Studio 2013\Projects\PrototypeNew\PrototypeNew-branch" />
  </application>
  <bindings>
    <binding protocol="http" bindingInformation="*:44300:localhost" />
  </bindings>
</site>

我的网站发布到托管环境后同样的问题。
http://mywebsite.com 重定向我 https://mywebsite.com ,并显示了同样的错误作为本地主机页面。

I have the same problem after publishing the website to a hosting environment. Going to http://mywebsite.com redirects me to https://mywebsite.com and shows the same error as the localhost page.

如果我重新启用SSL,然后在我的本地https的地址开始正常工作。

If I re-enable SSL then the https address on my localhost starts working fine.

有谁知道是怎么回事呢?是否有其他SSL开关的地方,我忘了关?为什么总是我重定向到https

Does anyone know what is going on here? Is there another SSL switch somewhere that I forgot to turn off? Why is it always redirecting me to https

编辑。尝试创建一个新的asp.net的MVC 4项目。推出它,它是工作的罚款。复制web.config中我的项目,它仍然重定向到的https:本地主机

EDIT. Tried creating a new asp.net mvc 4 project. Launched it and it was working fine. Copied the web.config to my project and it was still redirecting to https:localhost

推荐答案

好吧,我终于找到了解决办法。 FilterConfig.cs看起来像以下内容:

Okay I finally found the solution. FilterConfig.cs looked like the following:

public static void RegisterGlobalFilters(GlobalFilterCollection filters)
    {
        filters.Add(new HandleErrorAttribute());
        filters.Add(new System.Web.Mvc.AuthorizeAttribute());
        filters.Add(new RequireHttpsAttribute()); // problem
    }

它必须有自动,当我启用了SSL后再也无法将其删除添加的RequireHttpsAttribute。取出手动解决了这一问题。

It must have automatically added the RequireHttpsAttribute when I enabled SSL and then didn't remove it. Removing it manually fixed the problem.

这篇关于无法禁用SSL的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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