Bug #88835
closedfatal error in settings-controller when [HTTP][proxy] is array
Added by Peter Niederlag over 5 years ago. Updated about 3 years ago.
100%
Description
According to documentation one can set Install Tool configuration "[HTTP][proxy]" to an array to be able to set different proxies for http/https or to set the no_proxy option.
When we set this configuration via an editor the Settings Module "Configure Installation-Wide Options" will die with an Exception. :-<
On this spot item.value will be an array, resulting in the exception as arrays can't be cropped
Updated by Peter Niederlag over 5 years ago
- Related to Bug #85781: Cannot save [HTTP][proxy] added
Updated by Guido Schmechel over 5 years ago
Hi Peter,
i had already dealt with it in version 8. Unfortunately it is not really trivial. I test with this example:
'HTTP' => [
'proxy' => [
'http' => 'tcp://localhost:8125',
'https' => 'tcp://localhost:9124',
'no' => ['.mit.edu', 'foo.com']
],
],
Field "proxy" is defined as "mixed" in typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml. We could change it to "array". Then we have two new problems:
- keys (e.g. http) are lost
- multi-dimensional array doesn't work. Result "tcp://localhost:8125, tcp://localhost:9124, Array"
Workaround: Override the values in the AdditionalConfiguration.php
To "fix" this issue, I would suggest the following: We should clarify the help text:
A single proxy can be specified as a string. To define an proxy array, see http://docs.guzzlephp.org/en/latest/request-options.html#proxy, the values in the AdditionalConfiguration.php must be overridden.
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/+/61376
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/+/61376
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/+/61376
Updated by Gerrit Code Review over 5 years ago
Patch set 4 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/+/61376
Updated by Gerrit Code Review over 5 years ago
Patch set 5 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/+/61376
Updated by Gerrit Code Review about 5 years ago
Patch set 6 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/+/61376
Updated by Gerrit Code Review about 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/+/61593
Updated by Guido Schmechel about 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset fbe8d10ab20f43022d18d314a0d9f98fb4332456.
Updated by Benni Mack almost 5 years ago
- Status changed from Resolved to Closed
Updated by Georg Ringer about 4 years ago
- Related to Bug #91170: PHP Warning: mb_strlen() expects parameter 1 to be string, array given in /srv/www/htdocs/t3intranetnedev/web/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 3371 added
Updated by Webtech AG about 4 years ago
Sorry for reopening this issue. I have the same situation and tried to fix it with the AdditionalConfiguration.php file. I guess the code from the Guzzle-Example can't be used 1:1:
@$client->request('GET', '/', [ 'proxy' => [ 'http' => 'tcp://localhost:8125', // Use this proxy with "http" 'https' => 'tcp://localhost:9124', // Use this proxy with "https", 'no' => ['.mit.edu', 'foo.com'] // Don't use a proxy with these ] ]);@
So please give me an example how to do and achive it in TYPO3 AdditionalConfiguration.php accurately! I tried following code which doesn't work:
$GLOBALS['TYPO3_CONF_VARS']['HTTP']['proxy'] => [ 'http' => 'tcp://localhost:8125', // Use this proxy with "http" 'https' => 'tcp://localhost:9124', // Use this proxy with "https", 'no' => ['.mit.edu', 'foo.com'] // Don't use a proxy with these ]
In the TYPO3 Doc [[https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/GlobalValues/Typo3ConfVars/Index.html#file-additionalconfiguration-php]] it is not clear how to do that, if you are not experienced with this.
Thanks in advance for your support.
Daniel
Updated by Lukas Maxheim over 3 years ago
Webtech AG wrote in #note-15:
Sorry for reopening this issue. I have the same situation and tried to fix it with the AdditionalConfiguration.php file. I guess the code from the Guzzle-Example can't be used 1:1:
[...]
So please give me an example how to do and achive it in TYPO3 AdditionalConfiguration.php accurately! I tried following code which doesn't work:
[...]
In the TYPO3 Doc [[https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/GlobalValues/Typo3ConfVars/Index.html#file-additionalconfiguration-php]] it is not clear how to do that, if you are not experienced with this.
Thanks in advance for your support.
Daniel
Hi Daniel,
please try the following within the AdditionalConfiguration.php:
<?php
$GLOBALS['TYPO3_CONF_VARS']['HTTP']['proxy'] = [
'http' => 'PROXY_FOR_HTTP',
'https' => 'PROXY_FOR_HTTPS',
'no' => [
'PROXY_1',
'PROXY_2',
'PROXY_3'
],
];
With these settings I was not able to reproduce the error. Can you confirm this?
Kind regards
Lukas
Updated by Daniel Kempf over 3 years ago
Hi Lukas
Thank you for your kind input. As soon as I have to do an upgrade on that website, approximately on September, I have the chance to try your solution. Then I'll give you a response
Best regards
Daniel
Updated by Daniel Kempf about 3 years ago
Hi Lukas
I tested your suggested settings for proxy servers with TYPO3 V10.4.20. I can confirm that these work.
Best regards
Daniel