Zen Cart Logo
Forums / General Questions / Unsecure items in SSL pages

Unsecure items in SSL pages

Views: 2,151

Results 1 to 17 of 17
13 Apr 2010, 10:55 AM
#1
quedex avatar

quedex

New Zenner

Join Date:
Apr 2010
Posts:
10
Plugin Contributions:
0

Unsecure items in SSL pages

This website im doing has just had the SSL installed so i go into my two configure files and turn on HTTPS

i know i havent used hard coded links as i made a point not to but my base href is referencing HTTP on my secure pages i checked the relevant files and they seem to be fine with..

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" />

the site can be found @ https://www.joshlingerie.com

any help would be appreciated

13 Apr 2010, 11:02 AM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Unsecure items in SSL pages

Talk to your host... The problem appears to be with your stylesheet.

13 Apr 2010, 12:45 PM
#3
quedex avatar

quedex

New Zenner

Join Date:
Apr 2010
Posts:
10
Plugin Contributions:
0

Re: Unsecure items in SSL pages

Thanks for the reply

i have checked the stylesheets none have hard coded urls or any problems i can see ?

13 Apr 2010, 1:01 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: Unsecure items in SSL pages

Quedex:

This website im doing has just had the SSL installed so i go into my two configure files and turn on HTTPS

i know i havent used hard coded links as i made a point not to but my base href is referencing HTTP on my secure pages
Then your host has configured the SSL incorrectly in the server settings.

13 Apr 2010, 1:21 PM
#5
quedex avatar

quedex

New Zenner

Join Date:
Apr 2010
Posts:
10
Plugin Contributions:
0

Re: Unsecure items in SSL pages

Thats what im thinking as there is no way to set the base href except from server side right ?

the base href is referencing http so of course all the relative paths will be from http and not https and thats the problem im having i'll email them again if that doesnt work i'll ring them :D

thanks guys

13 Apr 2010, 1:25 PM
#6
drbyte avatar

drbyte

Sensei

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

Re: Unsecure items in SSL pages

Zen Cart calculates the correct base href based on whether your server is properly reporting that it's in SSL mode.
There are a few oddball hosting companies who can't seem to figure out how to do that properly. Hopefully yours isn't one of them.

13 Apr 2010, 2:20 PM
#7
quedex avatar

quedex

New Zenner

Join Date:
Apr 2010
Posts:
10
Plugin Contributions:
0

Re: Unsecure items in SSL pages

i did see Ajeh's post with the....

<?php $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')) || (isset($_SERVER['SCRIPT_URI']) && strtolower(substr($_SERVER['SCRIPT_URI'], 0, 6)) == 'https:') || (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ) ) ? 'SSL' : 'NONSSL'; echo 'I SEE ' . $request_type; ?>

php test i put it on my server and https://www.joshlingerie.com/test.php comes back as i see NONSSL

can i use this to hassle my hosting company ?

many thanks

13 Apr 2010, 2:24 PM
#8
drbyte avatar

drbyte

Sensei

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

Re: Unsecure items in SSL pages

You can try. Good luck.

13 Apr 2010, 2:51 PM
#9
quedex avatar

quedex

New Zenner

Join Date:
Apr 2010
Posts:
10
Plugin Contributions:
0

Re: Unsecure items in SSL pages

thanks for all the help guys i know a little php but server configurations are beyond me without you guys i'd be lost

running that script should report back as i see SSL then if all is correct is that right? i just need a bit of ammo if the hosts say it's my problem AGAIN !

13 Apr 2010, 2:53 PM
#10
drbyte avatar

drbyte

Sensei

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

Re: Unsecure items in SSL pages

Yes .

13 Apr 2010, 2:57 PM
#11
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Unsecure items in SSL pages

When a host makes errors such as this, and then tries to tell you that it's something YOU are doing, then it's time to find a better host.

24 May 2010, 3:34 PM
#12
quedex avatar

quedex

New Zenner

Join Date:
Apr 2010
Posts:
10
Plugin Contributions:
0

Re: Unsecure items in SSL pages

Update* I still have to run the site fully behind the SSL as i still get " i see non ssl" from the above script

my server guys are telling me this....

When you access an atlas site over SSL, we set the variable X-Forwarded-SSL to 1 and SSL is set to 1

i have no idea wot this means any info on this would be appreciated !

many thanks

24 May 2010, 4:25 PM
#13
drbyte avatar

drbyte

Sensei

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

Re: Unsecure items in SSL pages

You could try updating the /includes/init_includes/init_file_db.php file by adding 2 extra lines, as shown below:```
$request_type = (((isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on' || $_SERVER['HTTPS'] == '1'))) ||
(isset($_SERVER['HTTP_X_FORWARDED_BY']) && strpos(strtoupper($_SERVER['HTTP_X_FORWARDED_BY']), 'SSL') !== false) ||
(isset($_SERVER['HTTP_X_FORWARDED_HOST']) && (strpos(strtoupper($_SERVER['HTTP_X_FORWARDED_HOST']), 'SSL') !== false || strpos(strtoupper($_SERVER['HTTP_X_FORWARDED_HOST']), str_replace('https://', '', HTTPS_SERVER)) !== false)) ||
(isset($_SERVER['SCRIPT_URI']) && strtolower(substr($_SERVER['SCRIPT_URI'], 0, 6)) == 'https:') ||
[B] (isset($_SERVER['HTTP_X_FORWARDED_SSL']) && ($_SERVER['HTTP_X_FORWARDED_SSL'] == '1' || strtolower($_SERVER['HTTP_X_FORWARDED_SSL']) == 'on')) ||
(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && (strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'ssl' || strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https')) ||
[/B]
(isset($_SERVER['HTTP_SSLSESSIONID']) && $_SERVER['HTTP_SSLSESSIONID'] != '') ||
(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443')) ? 'SSL' : 'NONSSL';

20 Jun 2010, 2:20 AM
#14
vinewebs avatar

vinewebs

New Zenner

Join Date:
Mar 2010
Posts:
4
Plugin Contributions:
0

Re: Unsecure items in SSL pages

Info for Network Solutions clients. Network Solutions will not allow the php script in Zen-Cart to detect SSL called pages. Here is a quote from a Network Solutions staff member on the NS user forums. Yet another reason to not use Network Solutions to host your Zen-Cart site.

Our proxy SSL doesn't allow server-side variables to detect HTTPS (secure). All server-side coding will always detect HTTP (non-secure), and for programs that attempt to redirect non-secure connections (http://) to a secure connection (https://) will result in an infinite loop and server error after 30 seconds.

The only ways around this is to
assume the connection is secure by making all the links to the sensitive pages https, or

use a client-side program (like javascript) to detect if it's secure and redirect if it's not. The coding below will do just that. Just modify it to redirect to the correct secure domain and add it into the HTML of any sensitive pages.

http://forums.networksolutions.com/index.php?s=&showtopic=6418&view=findpost&p=27418

20 Jun 2010, 2:23 AM
#15
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,611
Plugin Contributions:
0

Re: Unsecure items in SSL pages

vinewbs - are you saying you are hosted on NetSol?

20 Jun 2010, 3:16 AM
#16
vinewebs avatar

vinewebs

New Zenner

Join Date:
Mar 2010
Posts:
4
Plugin Contributions:
0

Re: Unsecure items in SSL pages

Yes, this site is on NetSol, not by choice, though. My client's non-ZenCart site was on NetSol prior to my converting it to a Zen-Cart. I have been discovering the NetSol issues since launching the site a week ago. Wish I had known about all the issues before; I would have recommended my client change hosts before we launched.

4 Jan 2011, 6:03 AM
#17
hovsepations avatar

hovsepations

New Zenner

Join Date:
Sep 2008
Location:
Toronto
Posts:
35
Plugin Contributions:
0

Re: Unsecure items in SSL pages

@vinewebs; did you find a solutions to your problem?

i'm trying to setup the SSL from Network Solutions hosted on HostUpOn, but they both say that everything is setup right, and that the problem is with zencart, does that make sense to anyone?