guzzle icon indicating copy to clipboard operation
guzzle copied to clipboard

[8.0] Final for no proxy settings for all php versions

Open gergokee opened this issue 2 years ago • 8 comments

Fix for issue mentioned in https://github.com/guzzle/guzzle/issues/3163

gergokee avatar Aug 18 '23 15:08 gergokee

Is this an issue with curl or PHP? I am reluctant to revert this and re-break the issue this was fixing. Do you know the exact last version of libcurl that has this issue, if this a PHP issue, the exact last version of PHP to have this issue?


I'll leave this PR on hold till we have that information.

GrahamCampbell avatar Aug 26 '23 10:08 GrahamCampbell

Is this an issue with curl or PHP? I am reluctant to revert this and re-break the issue this was fixing. Do you know the exact last version of libcurl that has this issue, if this a PHP issue, the exact last version of PHP to have this issue?

I'll leave this PR on hold till we have that information.

It is a curl issue, not php. cURL version: 8.2.1 (hint: php -i | grep cURL) but it worked the same wrong on earlier 8.1 too

oostapov avatar Aug 27 '23 14:08 oostapov

Ok, so what is the latest version of curl where this is broken, so we can decide if this is actually something we want to support? (not what is the latest version of curl)

GrahamCampbell avatar Aug 27 '23 17:08 GrahamCampbell

As I said it is broken on the 8.2.1 which is currently latest stable. It has been broken and worked this way for years. 7.29 is the oldest I can test with and since that version it has never worked correctly.

oostapov avatar Aug 28 '23 07:08 oostapov

I believe it has nothing to do with cURL as the cURL behaves quite predictable. It is an improper handling of the proxy settings by the guzzle. If we want to not use proxy for some domain we should force the curl having it in NO_PROXY setting instead of leaving it unset which leads to falling back to the ENV settings

oostapov avatar Aug 28 '23 07:08 oostapov

@GrahamCampbell

In short: my old fix was not a real fix. :/

Explanation:

The reason is that first i added $conf[\CURLOPT_PROXY] = ''; . This should have been okay. But then tests failed, so i accidentally added this: unset($conf[\CURLOPT_PROXY]); . Which is not a real fix, since we wanted to specifically set CURLOPT_PROXY to be empty, unsetting it does nothing :/

The reason now i want both CURLOPT_PROXY ='' and CURLOPT_NOPROXY set to the added values cause in older php versions CURLOPT_NOPROXY is not working. So setting both is the ultimate solution.

gergokee avatar Aug 28 '23 09:08 gergokee

I'm wondering if Guzzle 8.0 is the best place to fix this. I'm very conscious of breaking things for people.

GrahamCampbell avatar Mar 31 '24 13:03 GrahamCampbell