Project

General

Profile

Actions

Bug #88835

closed

fatal error in settings-controller when [HTTP][proxy] is array

Added by Peter Niederlag over 4 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2019-07-24
Due date:
% Done:

100%

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

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. :-<

https://github.com/TYPO3/TYPO3.CMS/blob/3e14a9d5c11cc08ff8c4bef2d83507ef88685286/typo3/sysext/install/Resources/Private/Partials/Settings/LocalConfiguration/SubSection.html#L28

On this spot item.value will be an array, resulting in the exception as arrays can't be cropped


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #85781: Cannot save [HTTP][proxy]Closed2018-08-08

Actions
Related to TYPO3 Core - 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 3371Closed2020-04-22

Actions
Actions #1

Updated by Peter Niederlag over 4 years ago

  • Related to Bug #85781: Cannot save [HTTP][proxy] added
Actions #2

Updated by Peter Niederlag over 4 years ago

  • Description updated (diff)
Actions #3

Updated by Guido Schmechel over 4 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:

  1. keys (e.g. http) are lost
  2. 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.

Actions #4

Updated by Gerrit Code Review over 4 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

Actions #5

Updated by Gerrit Code Review over 4 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

Actions #6

Updated by Gerrit Code Review over 4 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

Actions #7

Updated by Gerrit Code Review over 4 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

Actions #8

Updated by Gerrit Code Review over 4 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

Actions #9

Updated by Susanne Moog over 4 years ago

  • Target version set to next-patchlevel
Actions #10

Updated by Gerrit Code Review over 4 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

Actions #11

Updated by Gerrit Code Review over 4 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

Actions #12

Updated by Guido Schmechel over 4 years ago

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

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions #14

Updated by Georg Ringer over 3 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
Actions #15

Updated by Webtech AG over 3 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

Actions #16

Updated by Lukas Maxheim almost 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

Actions #17

Updated by Daniel Kempf almost 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

Actions #18

Updated by Daniel Kempf over 2 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

Actions

Also available in: Atom PDF