为什么Request.IsSecureConnection返回false时,真正的预计 [英] Why does Request.IsSecureConnection return false when true is expected

查看:1530
本文介绍了为什么Request.IsSecureConnection返回false时,真正的预计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有被检查Request.IsSecureConnection,以确保它是真的一个aspx页面,如果没有它重定向到安全页面在https://www.domain.com/page.aspx。

I have an aspx page which is checking Request.IsSecureConnection to ensure it is true, if not it does a redirect to the the secure page at https://www.domain.com/page.aspx.

该服务器已安装域的SSL证书,浏览器显示的挂锁图标。

The server has an SSL cert installed for the domain, and the browser shows the padlock icon.

同样的code运行良好在不同的服务器上,但现在Request.IsSecureConnection始终返回false。

The same code ran fine on a different server, but now Request.IsSecureConnection always returns false.

我创建了一个完全空aspx文件,只是打印Request.IsSecureConnection的返回值,它仍然是假的,所以没有其他内容从标准的HTTP请求来了。

I have created a completely empty aspx file, that just prints the return value of Request.IsSecureConnection and it is still false, so there is no other content coming from a standard http request.

任何人都可以提出什么可能导致这一点,或给我如何可能会发现是什么原因造成这总是返回false任何提示?

Could anyone suggest what might be causing this, or give any hints on how I might find out what is causing this to always return false?

推荐答案

如果有一个负载平衡路由器或与SSL终止您的Web服务器前面类似然后从那里到Web服务器的连接不会超过SSL。在这种情况下,你通常要检查一个特定端口上或头负载平衡器被设置的连接。

If there's a load balancing router or similar in front of your web server with ssl termination then the connection from there to your web server won't be over SSL. In this case you usually have to check for a connection on a specific port or for headers being set by the load balancer.

这篇关于为什么Request.IsSecureConnection返回false时,真正的预计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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