Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SSL can't add to basket


robburne

Recommended Posts

Hi Everyone,

Since installing a self-sign SSL certificate on v 2.3.4 of my store I am unable to add items to my cart - I get a message that my cart is empty.

My config as as follows:

define('HTTP_SERVER', 'https://foobar.com');
define('HTTPS_SERVER', 'https://foobar.com');
define('ENABLE_SSL', true);
define('HTTP_COOKIE_DOMAIN', 'www.foobar.com');
define('HTTPS_COOKIE_DOMAIN', 'www.foobar.com');
define('HTTP_COOKIE_PATH', '/');
define('HTTPS_COOKIE_PATH', '/');
define('DIR_WS_HTTP_CATALOG', '/');
define('DIR_WS_HTTPS_CATALOG', '/');
define('DIR_WS_IMAGES', 'images/');
define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
define('DIR_WS_INCLUDES', 'includes/');
define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
define('DIR_FS_CATALOG', '/home/foobar.com/');
define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

There are plenty of other posts to be found reporting this issue without any definitive solution. Is this an issue with OS Commerce - seems to be the case?

Link to comment
Share on other sites

A self-signed cert will display a warning and require your customers to accept it so it shouldn't be used. I haven't tried using one on a live shop for that reason but I doubt it would work the way your configure file is setup. The configure file is saying there is a cert for the domain name, which there isn't. You can try turning off the ssl option. That won't turn off the self-signed cert since that is applied by the server.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

1 hour ago, robburne said:

Is this an issue with OS Commerce - seems to be the case?

check with your host or in your control panel and see if you have access to "Let’s Encrypt" if you do use its free auto assign ssl, it will last 90 days and then auto renew automaticly.

Works flawlessly with osC , have it running on a number of sites. You will have to delete your self signed ssl first.

https://letsencrypt.org/

 

Link to comment
Share on other sites

Actually I just checked, I am using a Let#s Encrypt SLL, apologies for the mis-information.

I understand that the self-signed is a bad choice however I don't understand how this would cause the basket to be empty.

So given that my cert is issued by Let's Encrypt and my config is as above, why can't I add items to the cart?

 

Link to comment
Share on other sites

Self signed would mean you had to set up the cert manualy which you probably did wrong! deleat the manual cert and use the auto sign method and then see what you have. Also make sure your config is correct in shop and admin.

Also would help to check error log and see what if anything is reported.

 

Link to comment
Share on other sites

I didn't ever install the self signed, my host offers 3 options, the self-signed, let's encrypt and a paid version. The Let's Encrypt is done automatically with one click.

I forgot to mention and I'm not sure if it is of significance but my shop is on a sub-domain of my main domain. The cert was installed for the subdomain though.

I will check my logs - hadn't thought of that.

Link to comment
Share on other sites

6 hours ago, robburne said:

Since installing a self-sign SSL certificate on v 2.3.4 of my store I am unable to add items to my cart

😊 we can only advise based on what you say. Still check both configs are pointing to the same places , especially the cookies as that is the main cause of empty baskets.

The error logs should show something.

Re: https on subdomain
  1. Setup your subdomains.
  2. In cpanel go to SSL/TLS.
  3. Install and Manage SSL for your site (HTTPS) > Manage SSL sites.
  4. add the key and certificate you gets from step 2 to all domains and subdomains.

 

Link to comment
Share on other sites

Apologies - here is my revised config:

define('HTTP_SERVER', 'https://shop.foobar.com');
define('HTTPS_SERVER', 'https://shop.foobar.com');
define('ENABLE_SSL', true);
define('HTTP_COOKIE_DOMAIN', 'shop.foobar.com');
define('HTTPS_COOKIE_DOMAIN', 'shop.foobar.com');
define('HTTP_COOKIE_PATH', '/');
define('HTTPS_COOKIE_PATH', '/');
Link to comment
Share on other sites

Ok I am beaten - this isn't worth the effort it really isn't. This thread is heading in the same direction as every other thread on this topic.

This is clearly an issue with OS Commerce - there are plenty of examples of this problem and so one ever gets or posts a solution.

For the record I can't login to admin now - page just refreshes. Go figure!

Link to comment
Share on other sites

I think I got to work:

define('HTTP_SERVER', 'https://www.shop.foobar.com');
define('HTTPS_SERVER', 'https://www.shop.foobar.com');
define('ENABLE_SSL', true);
define('HTTP_COOKIE_DOMAIN', '.www.shop.foobar.com');
define('HTTPS_COOKIE_DOMAIN', '.www.shop.foobar.com');
define('HTTP_COOKIE_PATH', '/');
define('HTTPS_COOKIE_PATH', '/');

I was missing the www which was causing the problems. I also tested this by having my host redirect all www traffic to http:// and that now works with my previous config.

Hopefully this will help someone else who arrives here with the same problem

Link to comment
Share on other sites

14 hours ago, robburne said:

This is clearly an issue with OS Commerce - there are plenty of examples of this problem and so one ever gets or posts a solution.

So I guess it wasn't an OS Commerce problem?

Dan

Link to comment
Share on other sites

It was nice that you came back to report on it.   Often people don't do that and as you pointed out, it looks like their plea for help went unanswered.

Dan

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...