We use Stunnel (to strip out SSL) and HAProxy on our Load Balancer – which then sends on requests to IIS via HTTP.
The problem we have is we want our sites (ASP.NET) to set cookies in a secure fashion – i.e. by setting the requireSSL attribute to true.
When we set this attribute and make a HTTPS request to the site, we get this error:
The application is configured to issue secure cookies. These cookies require the browser to issue the request over SSL (https protocol). However, the current request is not over SSL.
Is it possible to trust the webserver if the the request is coming over SSL from the load balancer? Or is this a non-problem as it is ONLY possible to access our site via SSL (only 443 is open)?
Instead of this:
try this:
If you are using ASP.NET MVC, you could also use a global action filter which sets the secure flag on all cookies in the response