Project

General

Profile

Actions

Bug #86356

closed

Checking $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] should be disabled when running initial setup wizard

Added by Matthias Schröder about 6 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2018-09-23
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Steps to reproduce:

  1. Install TYPO3 according to https://docs.typo3.org/typo3cms/InstallationGuide/QuickInstall/Composer/Index.html in a webserver that is proxied by a reverse proxy that terminates SSL.
  2. "Hit the start page of your freshly created site with your browser and you should see the "thank you for downloading"-message."

Error:

2018/09/23 10:36:42 [error] 14#14: *43 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught UnexpectedValueException: The current host header value does not match the configured trusted hosts pattern! Check the pattern defined in $GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] and adapt it, if you want to allow the current host header 'www.xyz.local' for your installation. in /var/www/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php:2803

But this is not possible, as there is no LocalConfiguration.php yet and the AdditionalConfiguration.php seems to be ignored at this time. The only way to get the setup wizard running is commenting

if (!static::isAllowedHostHeaderValue($retVal)) {
    throw new \UnexpectedValueException(
        'The current host header value does not match the configured trusted hosts pattern! Check the pattern defined in $GLOBALS[\'TYPO3_CONF_VARS\'][\'SYS\'][\'trustedHostsPattern\'] and adapt it, if you want to allow the current host header \'' . $retVal . '\' for your installation.',
        1396795884
    );
}

in GeneralUtility.php

and

$defaultPort = GeneralUtility::getIndpEnv('TYPO3_SSL') ? '443' : '80';
$this->messageQueue->enqueue(new FlashMessage(
    'The trusted hosts pattern will be configured to allow all header values. This is because your $SERVER_NAME:[defaultPort]'
        . ' is "' . $_SERVER['SERVER_NAME'] . ':' . $defaultPort . '" while your HTTP_HOST:SERVER_PORT is "'
        . $_SERVER['HTTP_HOST'] . ':' . $_SERVER['SERVER_PORT'] . '". Check the pattern defined in Admin'
        . ' Tools -> Settings -> Configure Installation-Wide Options -> System -> trustedHostsPattern'
        . ' and adapt it to expected host value(s).',
    'Trusted hosts pattern mismatch',
    FlashMessage::ERROR
));

in SetupCheck.php temporarily. Therefore, this check should be disabled during the initial setup.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #88846: Install tool (on FIRST_INSTALL) warns about "Trusted hosts pattern mismatch" although 'trustedHostsPattern' is set correctly (if no LocalConfiguration.php is present)Closed2019-07-26

Actions
Related to TYPO3 Core - Bug #103959: TYPO3 fresh installation in DDEV routing context fails on Trusted Hosts Pattern MismatchClosedGarvin Hicking2024-05-31

Actions
Actions #1

Updated by Jonas Eberle over 5 years ago

  • Related to Bug #88846: Install tool (on FIRST_INSTALL) warns about "Trusted hosts pattern mismatch" although 'trustedHostsPattern' is set correctly (if no LocalConfiguration.php is present) added
Actions #2

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/c/Packages/TYPO3.CMS/+/61374

Actions #3

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/c/Packages/TYPO3.CMS/+/61374

Actions #4

Updated by Gerrit Code Review over 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/c/Packages/TYPO3.CMS/+/61374

Actions #5

Updated by Gerrit Code Review over 5 years ago

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

Actions #6

Updated by Anonymous over 5 years ago

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

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions #8

Updated by Garvin Hicking 6 months ago

  • Related to Bug #103959: TYPO3 fresh installation in DDEV routing context fails on Trusted Hosts Pattern Mismatch added
Actions

Also available in: Atom PDF