NopCommerce with SSL enabled

Discussion in 'Third-party applications' started by mattsoundworld, Jan 1, 2014.

  1. Funky issue with NopCommerce and SSL has arisen.

    SSL is enabled, but when I try to call https://www.betterthanrice.com I get a firefox error 'redirect won't complete'.

    NopCommerce is detecting my homepage should not be accessed via https and is attempting to redirect to http. Pages which are supposed to be secure (https://www.betterthanrice.com/login) work as they are supposed to.

    NopCommerce forums indicate the problem might be at the hosting level. Given the popularity of this software, I'm wondering if anyone else has had this issue and more importantly, how to fix it!

    Thanks in advance.
     
  2. martino

    martino DiscountASP.NET Staff

    I believe the problem is coming from a custom error you're getting on your site account. I notice the problem when I visited the site with out the HTTPS protocol. It was redirecting me to a custom error page your web application is using. "We're sorry, an internal error occurred."

    So this is what I think is happening, you have an application issue on the site. When you try to visit the site via HTTPS it tries to connect but since the site is having a problem is trying to redirect to your custom error page. Thus, leading to the misleading error you're getting via HTTPS.

    Somethings you can try is create a Failed request trace that you can set up through our control panel here: https://my.discountasp.net/web-manager/iis8-settings.aspx This will help you get to the bottom of why the site is failing to load and hopefully resolve the redirect issue too.

    You can also try disabling the custom error setting in the web.config file to get the real error message directly on the web browser. Remember you have to use http://www.betterthanrice.com to see the issue. Once you have resolved that problem. Try using the URL with the HTTPS protocol here: https://www.betterthanrice.com
     
    mjp likes this.
  3. Martino,

    I was actually working a separate issue, being that the app pool was being recycled and that was crashing my site. Still haven't figured that one out, but I found a resolution for this by switching to client side redirect.

    When I was looking at the traffic via Fiddler, I noticed that the redirect was trying to switch to http://www.betterthanrice.com:443, and iis was having no truck with that. Also, behind the scenes I was getting a 'cannot redirect after HTTP headers have been sent' error. NopCommerce uses a .NET helper GetLeftPart(url) which returns the port when it is not the default :80, and I think you must have some setup on the shared hosting which makes this become relevant.

    Nevertheless, I simply switched the response to a client side redirect and it seems to be working for now.
     

Share This Page