Zen Cart Logo
Forums / General Questions / Site won't switch into SSL mode - using servage.net hosting

Site won't switch into SSL mode - using servage.net hosting

Locked

Views: 6,602

Results 21 to 27 of 27
This thread is locked. New replies are disabled.
23 Feb 2008, 8:17 PM
#21
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Site won't switch into SSL mode - using servage.net hosting

Badvoc:

I'm not sure what to do now....

since I haven't put any stock or anything in yet perhaps the easiest route would be to delete and re-install Zen in https://secure.gothicmagic.co.uk

but then I guess that would have to be my shop url which isn't very nice.

But in short it looks like I cocked it up when I bought my SSL cert, it suggested secure in front of my url by default and I just went with it, live and learn I guess.s

You can try it.
My guess is that you'll have the same mess when you're done, and be no further ahead other than to be certain that your host's server setup is ... well ... bad.

23 Feb 2008, 8:17 PM
#22
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Site won't switch into SSL mode - using servage.net hosting

If this was not one of the expensive ones, and I hope it was not...You can obtain another and possibly have it issued to the www. domain url also

27 Feb 2008, 3:03 PM
#23
badvoc avatar

badvoc

New Zenner

Join Date:
Feb 2008
Posts:
45
Plugin Contributions:
0

Re: Site won't switch into SSL mode - using servage.net hosting

Doing this appears to have cured the problems:

Comment out the original lines (use // in front of them) and add the following underneath:

$request_type = (getenv('HTTP_X_FORWARDED_HOST') == 'secure.gothicmagic.co.uk') ? 'SSL' : 'NONSSL';

The files and lines are:

admin\includes\init_includes\init_file_db_names.php Line 20
includes\init_includes\init_file_db_names.php Line 18
includes\modules\payment\paypal\ipn_application_top.php Line 46

I think that's them all. Basically we need to set the variable $request_type to either SSL or NOSSL appropriately.

it appears to be working now, can anyone see any problems with having done the above? A guy on https://www.dropshipforum.co.uk told me to try it but says he's only learning about Zen but thought it should work.

28 Feb 2008, 5:31 AM
#24
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Site won't switch into SSL mode - using servage.net hosting

Does it work also if you change that line to this instead:

$request_type = ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == '1') || (isset($_SERVER['HTTP_X_FORWARDED_BY']) && strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_BY']),'SSL')) || (isset($_SERVER['HTTP_X_FORWARDED_HOST']) && (strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_HOST']),'SSL') || strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_HOST']),str_replace('https://', '', HTTPS_SERVER))) ) || || (isset($_SERVER['SCRIPT_URI']) && strtolower(substr($_SERVER['SCRIPT_URI'], 0, 6)) == 'https:') || (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ) ) ? 'SSL' : 'NONSSL';

29 Feb 2008, 10:38 AM
#25
badvoc avatar

badvoc

New Zenner

Join Date:
Feb 2008
Posts:
45
Plugin Contributions:
0

Re: Site won't switch into SSL mode - using servage.net hosting

lol it appears to be working fine, I'm not changing anything now that it's working :P

29 Feb 2008, 5:59 PM
#26
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Site won't switch into SSL mode - using servage.net hosting

I was hoping that if what I posted will work in your case that it may work for others as well, and therefore could be included in the next version of Zen Cart.

But thanks anyway.

4 Oct 2008, 5:09 AM
#27
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Site won't switch into SSL mode - using servage.net hosting

DrByte:

I was hoping that if what I posted will work in your case that it may work for others as well, and therefore could be included in the next version of Zen Cart.

But thanks anyway.DrByte, the code you posted has some error in it, should be:

$request_type = ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ||
(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == '1') ||
(isset($_SERVER['HTTP_X_FORWARDED_BY']) && strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_BY']),'SSL')) ||
(isset($_SERVER['HTTP_X_FORWARDED_HOST']) && (strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_HOST']),'SSL') ||
strstr(strtoupper($_SERVER['HTTP_X_FORWARDED_HOST']),str_replace('https://', '', HTTPS_SERVER))) ) ||
(isset($_SERVER['SCRIPT_URI']) && strtolower(substr($_SERVER['SCRIPT_URI'], 0, 6)) == 'https:') ||
(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ) ) ? 'SSL' : 'NONSSL';

And I can confirm it doesnt solve the problem in my customer case.