Why does Request.IsSecureConnection return false when true is expected

前端 未结 2 949
清酒与你
清酒与你 2020-12-10 01:30

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.<

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 02:15

    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.

提交回复
热议问题