-
Incident report
-
Resolution: Fixed
-
Minor
-
1.9.0 (alpha)
-
None
-
RHEL 5, Zabbix 1.7.1-alpha, Apache 2.2.x, PHP 5.1
When running ZABBIX GUI with a HTTPS-only web server, the sorting of items (e.g. in Configuration section) will not work because the sort links are created using "http://" prefix.
To reproduce:
- Set up ZABBIX GUI in a HTTPS virtual host
- Disable any non-encrypted HTTP access
- Go to "Configure -> Hosts"
- Click on any of the table headers for sorting
- Get 404 or connection refused, depending on your web servers configuration (because the link points to http://server/hosts.php instead of https://server/host.php)
How to fix:
- See patch below (it's not shttp but https, and the right way to detect the protocol to use is evaluating _SERVER['HTTPS'], the "SERVER_PROTOCOL" will always be HTTP/1.x
– snip patch –
— zabbix-1.7.1/frontends/php/include/classes/class.curl.php.orig 2009-11-03 10:53:22.000000000 +0100
+++ zabbix-1.7.1/frontends/php/include/classes/class.curl.php 2009-11-03 10:54:19.000000000 +0100
@@ -50,8 +50,11 @@
if(empty($url)){
$this->formatArguments();
-
- $protcol = (strpos(strtolower($_SERVER['SERVER_PROTOCOL']), 'shttp') !== false)?'shttp':'http';
+ if ($_SERVER['HTTPS'] == "on") { + protcol = "https"; + }else
{ + $protcol = "http"; + }$this->url = $url = $protcol.'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].$_SERVER['SCRIPT_NAME'].'?'.$this->getQuery();
}
else{
– snap patch –