Redirect Loop

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
No. But I'll check it
14 years ago
Thank you. I am looking forward to hear from you. For the time being I will just go ahead and disable the ssl flag.

Thanks you so much in advance,

Smitty
14 years ago
after spending 20 hours on this, I finally found the solution. The issue wasn't the godaddy ssl certificate, I found this out after I went and got another ssl from rapidssl. The issue is rackspace use a load balancer on their server so the Request.IsSecureConnection is never got set to true. I ended up using a server variable instead. Below is the solution on the CommonHelper.cs on the EnsureSSL function

public static void EnsureSSL()
        {
          bool IsSecureConnection = false;
          try
          {
            IsSecureConnection = HttpContext.Current.Request.ServerVariables["HTTP_CLUSTER_HTTPS"] == "on" ? true : false;
          }

          catch
          {
            IsSecureConnection = false;
          }  
          
          if (!IsSecureConnection)
            {
                if (SettingManager.GetSettingValueBoolean("Common.UseSSL"))
                {
                    if (!HttpContext.Current.Request.Url.IsLoopback)
                    {
                        ReloadCurrentPage(true);
                    }
                }
            }
        }

I hope this solution will save some one else 20 hours.
13 years ago
I am attempting to install nopcommerce on a Load Balanced Server and have been experienced the issue where Request.IsSecureConnection always returning false.

I have also used something similar to the solution that code warrior used using HttpContext.Current.Request.ServerVariables["HTTP_CLUSTER_HTTPS"]

Unfortunately this variable is never set.  I suspect that this variable is only available in some load balanced environments.

I have tried HttpContext.Current.Request.Url.Scheme.  This always returns http on a https page?

Does anyone have a suggestion as to how I can solve this one?
13 years ago
Has any one come up with a solution to this problem? I'm in a load balanced environment and I'm running into this exact issue.

I tried the solution posted by code warrior, however it isn't working for me. I love any ideas on this one.
13 years ago
Hi Ryan,

Just to summarise the problem.  In a Load Balanced environment the SSL connection stops at the load balancer so that you can never test for an SSL connection using standard methods such as:
- HttpContext.Current.Request.IsSecureConnection
- HttpContext.Current.Request.Url.Scheme
- Request.ServerVariables["HTTPS"]

In a load balanced environment a custom request gets inserted into the header to assist in identifying a secure request.  Assuming that your host has setup this variable on their load balancer its name could be anything.  In the case of Rackspace it appears to be "HTTP_CLUSTER_HTTPS". In my case the name was "HTTP_NR_SSL", this being the name setup for the Host Net Registry.

Contact your host and ask them for the server variable to identify a HTTPS request in a load balanced environment.  With the correct variable name Code Warriors solution should work for you.

Regards,
Tayls
13 years ago
I have a similar problem

I have SSL almost working -  90%.
Port 80 the site works 100%.

I changed web.config UseSSL=”true”
Configured IIS bindings for 443.

The only links that do not work, are any url with ‘category’ in the URL, like, https://www.mystore.com/category/29-categoryname.aspx

They seem to try to open, but continue to ping the page and hang up the browser.

After further investigation, I get repeated “302 Temporarily Moved” Http Status Codes for these URL’s.

Does anyone have any ideas?
Is this a bug in Nopcommerce?
13 years ago
Looks like any URL Rewrite cannot be displayed in SSL mode.
Categories, news, etc. cannot render with SSL turned on.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.