SSL detection is piss poor, so enforcing SSL in a reverse-proxy scenario causes endless redirect loops. Must find better way to detect whether SSL has been used (with CloudFlare, Pound, etc.) Until then, disable SSL enforcer.

This commit is contained in:
Rick Falkvinge
2014-09-08 19:07:39 +00:00
parent 999750689d
commit 6eba31c786
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -61,7 +61,8 @@ namespace Swarmops
// Check for SSL and force it
if ((!Request.IsSecureConnection) && Request.Url.ToString().StartsWith("http://")) // Both are necessary, as some reverse proxies will https-ify an original nonsecure connection. First is state at server, second is state at client
/* DISABLED - WORKS REALLY POORLY WHEN IN COMPLEX DEPLOYMENTS. MUST IMPROVE DETECTION MECHANISM
if (Request.Url.ToString().StartsWith("http://")) // only check client-side as many server sites de-SSL the connection before reaching the web server
{
if (!Request.Url.ToString().StartsWith("http://dev.swarmops.com/") && !Request.Url.ToString().StartsWith("http://sandbox.swarmops.com") && !Request.Url.ToString().StartsWith("http://localhost:") && !Request.Url.ToString().StartsWith("http://swarmops-"))
{
@@ -70,7 +71,7 @@ namespace Swarmops
// Only force this if set to force it in database
// TODO: Make admin init task
}
}
}*/
Localize();
+1 -1
View File
@@ -33,7 +33,7 @@ namespace Swarmops.Pages.Security
// Check for SSL
/* DISABLE temporarily
if ((!Request.IsSecureConnection) && Request.Url.ToString().StartsWith("http://")) // Both are necessary, as some reverse proxies will https-ify an original nonsecure connection
if ((!Request.IsSecureConnection) && (!Request.Url.ToString().StartsWith("https://"))) // Both are necessary, as some reverse proxies will https-ify an original nonsecure connection
{
if (!Request.Url.ToString().StartsWith("http://dev.swarmops.com/") && !Request.Url.ToString().StartsWith("http://localhost:") && !Request.Url.ToString().StartsWith("http://swarmops-"))
{