[BUGFIX] getIndpEnv('TYPO3_SSL') fails to detect reverseProxyIp 81/30581/4
authorJan-Erik Revsbech <janerik@moc.net>
Thu, 5 Jun 2014 09:33:54 +0000 (11:33 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Fri, 6 Jun 2014 09:38:16 +0000 (11:38 +0200)
When running TYPO3 behind a reverse proxy, which also handles SSL,
the setting reverseProxySSL should check if the site is requested
from one of the reverse proxies in order to determine whether
the site is using SSL.

It incorrectly does this check via getIndpEnv('REMOTE_ADDR') which has
already translated the proxy IP to the end-users IP, thus always
returning FALSE.

Resolves: #37467
Release: 6.2, 6.1
Change-Id: I95615b0fea94e0ef0222e958e4e0bba5e6e9f60a
Reviewed-on: https://review.typo3.org/30581
Reviewed-by: Wouter Wolters
Reviewed-by: Mattias Nilsson
Tested-by: Mattias Nilsson
Reviewed-by: Jan-Erik Revsbech
Tested-by: Jan-Erik Revsbech
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/core/Classes/Utility/GeneralUtility.php

index c872a6d..fbac326 100644 (file)
@@ -3509,7 +3509,7 @@ Connection: close
                                if ($proxySSL == '*') {
                                        $proxySSL = $GLOBALS['TYPO3_CONF_VARS']['SYS']['reverseProxyIP'];
                                }
-                               if (self::cmpIP(self::getIndpEnv('REMOTE_ADDR'), $proxySSL)) {
+                               if (self::cmpIP($_SERVER['REMOTE_ADDR'], $proxySSL)) {
                                        $retVal = TRUE;
                                } else {
                                        $retVal = $_SERVER['SSL_SESSION_ID'] || strtolower($_SERVER['HTTPS']) === 'on' || (string)$_SERVER['HTTPS'] === '1' ? TRUE : FALSE;