1
fatman
No lock when using SSL (general xoops pages)
  • 2004/9/23 22:16

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


I'm wondering if anyone else runs a XOOPS site with an SSL certificate?

I've got a site which has some secure pages. Our certificate on the server works fine. However when you change http:// for https:// in any XOOPS URL the encryption lock symbol (in both IE and Firefox) does not display. You can view certificate information no problem and data is getting encrypted. The only problem is there is no lock.

Anyone have a clue as to why? If I call any non-xoops URL the lock shows as it should.

2
christian
Re: No lock when using SSL (general xoops pages)
  • 2004/9/23 22:24

  • christian

  • Just can't stay away

  • Posts: 401

  • Since: 2002/2/24


Hello fatman

Look this article in the French speaking newsletter.

I hope that helps you

3
fatman
Re: No lock when using SSL (general xoops pages)
  • 2004/9/25 2:10

  • fatman

  • Friend of XOOPS

  • Posts: 176

  • Since: 2003/12/13


christian thank you very much.

I almost can't believe I didn't naturally think to do something like this from the start. While I can't read french I was able to easily spot the fix from the small code snippet.

Just in case someone else needs the fix from Christian's link, here is it.

// In mainfile.php
// change this line
define('XOOPS_URL''https: //www.example.org');

// to the following
$port $HTTP_SERVER_VARS['SERVER_PORT'];
if(
$port == "443"){
  
define('XOOPS_URL''https: //www.example.org');
} else {
  
define('XOOPS_URL''http: //www.example.org');
}


The solution is to have the server check what port the incoming request is coming in on. If the request is 443 (the default port used with ssl) we define the XOOPS_URL global variable as https instead of just http. This will ensure that all files which are included by your HTML templates (css, js, jpg, gif ect) will also use the secure protocol. Which is important if you want the lock in the web browser to show up.

4
christian
Re: No lock when using SSL (general xoops pages)
  • 2004/9/25 7:54

  • christian

  • Just can't stay away

  • Posts: 401

  • Since: 2002/2/24


Ok Fatman, but for this idea ($port == "443".....) its Ackbarr in this post

5
yomamaii
Re: No lock when using SSL (general xoops pages)
  • 2004/12/16 2:03

  • yomamaii

  • Just popping in

  • Posts: 4

  • Since: 2004/8/15


I tried this code and now my images do not show up any suggestions?

6
stephenv
Re: No lock when using SSL (general xoops pages)
  • 2005/3/8 15:40

  • stephenv

  • Just popping in

  • Posts: 14

  • Since: 2005/3/8 1


To avoid problems with internal links/references to the site (like to image files), there should be no space in the URL definitions within mainfile.php, i.e. no space between the "https:" (or "http:") part and the "//www.example.org" part.

== so it should look like this:

$port = $HTTP_SERVER_VARS['SERVER_PORT'];
if($port == "443"){
define('XOOPS_URL', 'https://www.example.org');
} else {
define('XOOPS_URL', 'http://www.example.org');
}

== instead of the original above, which is:

$port = $HTTP_SERVER_VARS['SERVER_PORT'];
if($port == "443"){
define('XOOPS_URL', 'https: //www.example.org');
} else {
define('XOOPS_URL', 'http: //www.example.org');
}

Login

Who's Online

275 user(s) are online (164 user(s) are browsing Support Forums)


Members: 0


Guests: 275


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits