NOP 1.90 Shared SSL Issue

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Hi There,

I have installed 1.90.  I have purchased a shared SSL.

I have followed the instructions in the manual to change to the following

<add key="UseSSL" value="true" />
    <add key="SharedSSLUrl" value="https://securesite18.appliedi.net/mystore-com/" />
    <add key="NonSharedSSLUrl" value="http://www.mystore.com/" />

BUT when I do this and place a test order, it is redirected to "https://securesite18.appliedi.net/mystore-com/mystore-com/"

or if I go back to homepage, the url is mystore.com/mystore.com/default.aspx

Why is it repeating my website url?

Thanks!
13 years ago
Hmmm, I am wondering if anyone else is having this issue that is hosted from Appliedi.net?

I found a note from version 1.70.  Has anyone tried this with 1.90? I have attached the link & the message below.

Thanks!

LINK: https://www.nopcommerce.com/boards/t/3969/how-to-get-shared-ssl-to-work.aspx


I had not been able to get shared SSL to work until now. Yes, I know about the web.config settings "UseSSL" and "SharedSSL".

When you set the SharedSSL value to a subdirectory of a secure site, the store behaves erracticly. For example, here is my SharedSSL setting:

<add key="SharedSSL" value="https://secure.etgroup.net/etgnop" />

When I run the site, very often it will modify the URL to this:

https://secure.etgroup.net/etgnop/ETGNOP

Notice the extra ETGNOP that it generates.

Futhermore, on some links it will attempt to remove the "s" from "https" and clobber the store that way.

Here is how I fixed it.

1. Open up the Nop.Common project in Visual Studio.

2. Find the GetStoreLocation function and change the lines below highlighted in bold

public static string GetStoreLocation(bool UseSSL)
        {
            string result = GetStoreHost(UseSSL);
            if (result.EndsWith("/"))
                result = result.Substring(0, result.Length - 1);
            //ETG - Fix for shared SSL.
            //result = result + HttpContext.Current.Request.ApplicationPath;
            if (!result.EndsWith("/"))
                result += "/";

            return result;
        }

3. Find the EnsureNonSSL function and change the lines below highlighted in bold

public static void EnsureNonSSL()
        {
            if (IsCurrentConnectionSecured())
            {
                //ETG - Fix for shared SSL.
                //ReloadCurrentPage(false);
            }
        }

4. Compile the project and copy the updated DLL to your sites Bin folder.
13 years ago
I have a question:

According to nopTeam only  <add key="UseSSL" value="true" /> should be changed to true for using SSL certification on the website.

Then why you changes your webconfig lines like this ?

<add key="UseSSL" value="true" />
    <add key="SharedSSLUrl" value="https://securesite18.appliedi.net/mystore-com/" />
    <add key="NonSharedSSLUrl" value="http://www.mystore.com/" />

According to the post here: https://www.nopcommerce.com/boards/t/8157/need-help-enabling-ssl.aspx (only 1 line needs to be changed)

and here also: https://www.nopcommerce.com/boards/t/2972/how-to-make-the-shopping-cart-secure-with-an-ssl-certificate-.aspx
13 years ago
Re: I have a question:

According to nopTeam only  <add key="UseSSL" value="true" /> should be changed to true for using SSL certification on the website.

Then why you changes your webconfig lines like this ?

<add key="UseSSL" value="true" />
    <add key="SharedSSLUrl" value="https://securesite18.appliedi.net/mystore-com/" />
    <add key="NonSharedSSLUrl" value="http://www.mystore.com/" />




I am using Version 1.90.  In the manual, it states to change the webconfig <add key="UseSSL" value="false" /> to <add key="UseSSL" value="true" />

and add the shared SSL location: <add key="SharedSSLUrl" value="https://securesite18.appliedi.net/mystore-com/" />.  I did this but when I am checking out, an error occurs, and asks me for the "NonSharedSSLUrl" address.

But with changing these 3 lines, I get the repeated https://securesite18.appliedi.net/mystore-com/mystore-com

I am sure that others have run into this issue???

Thanks in advance for any help!
13 years ago
Has anyone come across this and hosted with appliedi.net?
13 years ago
Hi loulou,

I am the one that posted that work around for shared SSL. I got it partially working. The only remaining issues were when NOP would switch back and forth between SSL and non-SSL.

The carts and wishlists and whether or not you were logged or not would confuse NOP - as well it should be confused because the shared SSL URL is a completely different domain. The cookies and session state is totally different.

So, here is really the only way i could get it to work.

1. Change the web config values:

    <add key="UseSSL" value="true" />
    <add key="SharedSSLUrl" value="https://secure.etgroup.net/keywhitmanstore" />
    <add key="NonSharedSSLUrl" value="https://secure.etgroup.net/keywhitmanstore" />

Make sure the NonSharedSSLUrl is the same as SharedSSLUrl otherwise NOP will get a runtime error.

2. Modify and recompile the Nop.Common.dll. To do this download the NOP source code and open the project the project named Nop.Common located in the Libraries\Nop.Common folder.

Make these changes inside the CommonHelper.cs class located in the Utils folder:

Find the GetStoreLocation function and change the lines below highlighted in bold

public static string GetStoreLocation(bool UseSSL)
        {
            string result = GetStoreHost(UseSSL);
            if (result.EndsWith("/"))
                result = result.Substring(0, result.Length - 1);
            //ETG - Fix for shared SSL.
            //result = result + HttpContext.Current.Request.ApplicationPath;
            
            if (!result.EndsWith("/"))
                result += "/";

            return result;
        }

Find the EnsureNonSSL function and change the lines below highlighted in bold

public static void EnsureNonSSL()
        {
            if (IsCurrentConnectionSecured())
            {
                //ETG - Fix for shared SSL.
                //ReloadCurrentPage(false);
            
            }
        }

Compile the project and copy the updated DLL to your site's Bin folder.

3. The site will work now in shared SSL. But if you try and add a product to the shopping cart, it will come up empty on the SSL side. The non-SSL side will say you have items in the cart.

The only way that I have been able to fix this problem is to force the non-SSL site to run under the shared SSL URL the whole time.

You can accomplish this a number of ways.

1. Have the hosting provider redirect your main site to the shared SSL site on IIS Manager

2. Write ASP.NET code to sense the site is running in non-SSL and redirect it to the SSL Url. Ideally, you woud put this code in the Root.Master so it would apply to all pages.


This is a lot of work and it would be much easier to buy an dedicated SSL certificate. But if you need to preserve IP addresses and need it to work under shared SSL, this is the only way I could get it to work.
13 years ago
Thanks to JGarland for posting this.

I have read through alot of posts and it seems to be an issue on/off with NOPcommerce with previous versions as well.

BTW, does anyone out there that is more familar with doing coding that would be willing to do this for us?

Thanks!
13 years ago
I want to say thanks to JGarland for giving me this code but...

I did try it and still got errors using version 1.90.  ie. pictures not showing up on the ssl side, items disappearing from shopping cart...

I finally purchased a dedicated SSL and it works great.  I think with this software, it would be pointless to use unless you plan on purchasing a dedicated SSL.

Also, there is still the issue of reverting from https:// to http:// (ie. shopping cart to homepage) but I think this is how this software works.

Anyways, I hope this helps if you are planning on using a shared ssl?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.