Cannot enable secure connection at checkout

In admin, I am trying to enable a secure connection at checkout, but every time I check the box and save the settings, I get the following error message:



The secure connection check has failed. Please check HTTPS settings in the “config.php” file and make sure that SSL certificate is installed on your server.



This is my website: http://teamshop.discosports.com.



The path is a bit confusing. From the root, it lists the following folders:


  • discosports
  • teamshop



    Here is what I have entered in the local.config.php file.



    // Host and directory where software is installed on no-secure server

    $config[‘http_host’] = ‘teamshop.discosports.com’;

    $config[‘http_path’] = ‘’;



    // Host and directory where software is installed on secure server

    $config[‘https_host’] = ‘teamshop.discosports.com’;

    $config[‘https_path’] = ‘’;



    I left both [‘https_path’] = ‘’ & [‘http_path’] = ‘’ blank because I don’t know what the path would be, if the host is teamshop.discosports.com.



    Strange thing is, when I go to https://www.discosports.com or https://teamshop.discosports.com, in my browser, the site pulls up just fine, yet the cart will not allowing me to enable the secure feature at checkout.



    I use Network Solutions and do not believe this is a proxy issue.



    Any help is much appreciated.

First, this image path is “hardcoded”:


https://seal.networksolutions.com/images/basicrecgreen.gif



…and your certificate doesn’t work properly. You have to use this image from your server and the path should be something like that:


/images/basicrecgreen.gif

Hi ckad79,

Just like you use Network Solutions hosting and Secure Certificate. Tried to enable a secure connection at checkout, but Got the same error message as you.



Followed all the procedures from CS-cart - Secure connection fails: [url]CS-Cart Documentation — CS-Cart 4.15.x documentation

Still The secure connection check has failed…lol



use phpinfo to check

I found some weird things when compared the https detect code from prepare.php:

[QUOTE]// Detect https

if (isset($_SERVER[‘HTTPS’]) && ($_SERVER[‘HTTPS’] == ‘on’ || $_SERVER[‘HTTPS’] == ‘1’)) {

define(‘HTTPS’, true);

} elseif (isset($_SERVER[‘HTTP_X_FORWARDED_SERVER’]) && ($_SERVER[‘HTTP_X_FORWARDED_SERVER’] == ‘secure’ || $_SERVER[‘HTTP_X_FORWARDED_SERVER’] == ‘ssl’)) {

define(‘HTTPS’, true);

} elseif (isset($_SERVER[‘SCRIPT_URI’]) && (substr($_SERVER[‘SCRIPT_URI’], 0, 5) == ‘https’)) {

define(‘HTTPS’, true);

} elseif (isset($_SERVER[‘HTTP_HOST’]) && (strpos($_SERVER[‘HTTP_HOST’], ‘:443’) !== false)) {

define(‘HTTPS’, true);

}[/QUOTE]



Where My _SERVER[‘HTTP_X_FORWARDED_SERVER’] is my domain URL,

substr($_SERVER[‘SCRIPT_URI’], 0, 5) == ‘http:’ ,

_SERVER[“HTTP_HOST”] is my domain URL



I can run in http and https for my store. Netsol siteseal can pop-up the site is secure site information.



Your help is much appreciated!

As I researched for detect SSL connection in prepare.php script, It checks these server vars:

_SERVER[‘HTTPS’] , _SERVER[‘HTTP_X_FORWARDED_SERVER’], _SERVER[‘SCRIPT_URI’], _SERVER[‘HTTP_HOST’], and _SERVER[“SERVER_PORT”]



I run my _SERVER[‘SCRIPT_URI’] under https conection, but all these variable checks failed. What other methods can I detect the page is runing under https conection?



Any one have better suggetions? Any helps will be appreciated!

Finally, I found the problem is caused by PHP CGI/FastCGI module. Some web hosts implement php as a CGI/FastCGI in such a way that they can turn it on or off for each virtual domain. Several or all $_SERVER and $_ENV variable values may be the same in http and https mode. That is why I checked PHP Variables inside phpinfo() are the same in http and https mode, except remote port!



In this case, $_SERVER or $_ENV can’t work well to detect if https is on or not!!!



Right now, I can only direct point to the checkout and login page with full https link.



I think Cs-cart need to come out some manual https connection mode settings for this case…