Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006015TestLinkAvailable Fixespublic2013-10-31 17:512016-04-08 18:20
Reporterkenden 
Assigned Tofman 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
Platformfirefox 25OSlinux mintOS Version15 64b
Product Version1.9.8 (2013 Q3 - bug fixing) 
Fixed in Version1.9.9 (2013 Q4 - bug fixing) 
Summary0006015: Webserver: Nginx - https is forced incorrectly
DescriptionAfter installing, I am redirected to the page:
https://localhost/testlink/login.php [^]

And I see the content:

Unable to connect

Firefox can't establish a connection to the server at localhost.
Steps To ReproduceInstall Nginx + php5 + mysql
(following those steps:
http://www.howtoforge.com/installing-nginx-with-php5-and-php-fpm-and-mysql-support-lemp-on-ubuntu-13.04 [^])

Create a testlink database
Install Testlink 1.9.2

At the end of the installation, click the login link
----> get the problem
Additional InformationThe problem might be because of using nginx.
I used testlink before with Apache2 with no problem.

After investigating, it seems the problem is caused because the value
_SERVER["HTTPS"] has no value

Calling phpinfo() shows "no value".

To fix this, edit the function get_home_url()
in file lib/functions/configCheck.php

Change line:

else if ( isset( $_SERVER['HTTPS'] ) && ( strtolower( $_SERVER['HTTPS'] ) != 'off' ) )

by

else if ( !empty( $_SERVER['HTTPS'] ) && ( strtolower( $_SERVER['HTTPS'] ) != 'off' ) )


Can this be committed?
TagsNo tags attached.
Database (MySQL,Postgres,etc)mysql
Browserfirefox
PHP VersionPHP 5.4.9-4ubuntu2.3
TestCaseID
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Files

- Relationships
related to 0007495closedfman After successful installation, it is not possible to login as admin, if Nginx is used as a reverse Proxy 
child of 0005897closedfman Availables hot-fixes for 1.9.8 & How To get full fixed package from gitorious 

-  Notes
(0019939)
fman (administrator)
2013-10-31 20:30

solution can be

else if ( isset( $_SERVER['HTTPS'] ) && !empty( $_SERVER['HTTPS'] ) && ( strtolower( $_SERVER['HTTPS'] ) != 'off' ) )
(0019940)
fman (administrator)
2013-10-31 20:32

if you declare
>> Install Testlink 1.9.2

you can not set version to 1.9.8, please clarify.
Issues on version < 1.9.7 are ignored if you can not reproduce on 1.9.8

I only test on apache
(0019941)
kenden (reporter)
2013-10-31 22:03

Sorry that was a typo.
It is not
"Install Testlink 1.9.2"
it should be
"Install Testlink 1.9.8"

Nginx is becoming the new Apache2 it seems.

Regarding your solution:

else if ( isset( $_SERVER['HTTPS'] ) && !empty( $_SERVER['HTTPS'] ) && ( strtolower( $_SERVER['HTTPS'] ) != 'off' ) )

empty() already checks if a variable exists, so if you call empty, there is no need to call isset().

http://php.net/manual/en/function.empty.php [^]
"A variable is considered empty if it does not exist or if its value equals FALSE. empty() does not generate a warning if the variable does not exist."
So

else if ( !empty( $_SERVER['HTTPS'] ) && ( strtolower( $_SERVER['HTTPS'] ) != 'off' ) )

should be enough.
(0019944)
fman (administrator)
2013-11-01 09:11

checked how MantisBT fixed it, same to yours approach.
Fixed and commited

thanks
(0019945)
fman (administrator)
2013-11-01 09:12

https://gitorious.org/testlink-ga/testlink-code/commit/f76ba33cf81437707393b0b6286919daf6f28eff [^]
(0020054)
fman (administrator)
2013-11-17 09:53

1.9.9 Released

- Issue History
Date Modified Username Field Change
2013-10-31 17:51 kenden New Issue
2013-10-31 20:14 fman Summary Https is forced incorrectly => Webserver: Nginx - https is forced incorrectly
2013-10-31 20:30 fman Note Added: 0019939
2013-10-31 20:32 fman Note Added: 0019940
2013-10-31 20:32 fman Assigned To => fman
2013-10-31 20:32 fman Status new => feedback
2013-10-31 22:03 kenden Note Added: 0019941
2013-10-31 22:03 kenden Status feedback => assigned
2013-11-01 09:11 fman Note Added: 0019944
2013-11-01 09:12 fman Fixed in Version => 1.9.9 (2013 Q4 - bug fixing)
2013-11-01 09:12 fman Note Added: 0019945
2013-11-01 09:12 fman Status assigned => resolved
2013-11-01 09:12 fman Resolution open => fixed
2013-11-01 09:13 fman Relationship added child of 0005897
2013-11-17 09:53 fman Note Added: 0020054
2013-11-17 09:53 fman Status resolved => closed
2016-04-08 18:20 fman Relationship added related to 0007495



Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker