Bug #77781

url_scheme redirect doesn't work with TYPO3_SSL

Added by Patrick Kollodzik over 5 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2016-09-02
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

If you have a Website behind a proxy like Varnish and every connection goes to TYPO3 with http://. The scheme based redirect will not work, even if TYPO3 recognizes the connection as a HTTPS, beacuse the TYPO3_SSL enviroment variable is not used.

The problem is the test ist based only on the requested schema.

TypoScriptFrontendController.php:1466

 if ((int)$this->page['url_scheme'] === HttpUtility::SCHEME_HTTP && $requestUrlScheme == 'https') {
         $newUrl = 'http://' . substr(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), 8);
 } elseif ((int)$this->page['url_scheme'] === HttpUtility::SCHEME_HTTPS && $requestUrlScheme == 'http') {
         $newUrl = 'https://' . substr(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), 7);
 }

It should be something like that:

if ((int)$this->page['url_scheme'] === HttpUtility::SCHEME_HTTP && GeneralUtility::getIndpEnv('TYPO3_SSL') === TRUE) {
     $newUrl = 'http://' . substr(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), 8);
} elseif ((int)$this->page['url_scheme'] === HttpUtility::SCHEME_HTTPS && GeneralUtility::getIndpEnv('TYPO3_SSL') === FALSE) {
     $newUrl = 'https://' . substr(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'), 7);
 }

I found this in 6.2, but it is the same in 8.4-dev

#1

Updated by Gerrit Code Review over 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49752

#2

Updated by Gerrit Code Review over 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49752

#3

Updated by Gerrit Code Review almost 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49752

#4

Updated by Anonymous almost 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#5

Updated by Benni Mack about 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF