#91767ServerResponseCheck doesn't use TYPO3 HTTP config for GuzzleHttp Client
Description
The class sysext/install/Classes/SystemEnvironment/ServerResponse/ServerResponseCheck.php create a plain GuzzleHttp\Client class without to take $GLOBALS[‘TYPO3_CONF_VARS’][‘HTTP’] into account.
When f.e. a proxy server for requests is defined, this one isn’t used.
Affected versions: current 9.5 and 10.4
The crucial code lines are:
$client = new Client(['base_uri' => $this->baseUrl]);
foreach ($this->fileDeclarations as $fileDeclaration) {
$promises[] = $client->requestAsync('GET', $fileDeclaration->getFileName());
}
A possible fix (inspired by sysext/core/Classes/Http/RequestFactory.php), which worked for me:
$httpOptions = $GLOBALS['TYPO3_CONF_VARS']['HTTP'];
$httpOptions['verify'] = filter_var($httpOptions['verify'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) ?? $httpOptions['verify'];
$httpOptions['base_uri'] = $this->baseUrl;
$client = GeneralUtility::makeInstance(Client::class, $httpOptions);
foreach ($this->fileDeclarations as $fileDeclaration) {
$promises[] = $client->requestAsync('GET', $fileDeclaration->getFileName());
}
ServerResponseCheck was introduced in #91354
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.