-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Support CURLOPT_ECH #16305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Did you try with cURL 8.10.1? (8.10.0 was a bad release with known issues) |
Yes, I did. Actually tested with 8.8.0, 8.9.0 and 8.10.1 (did not even try 8.10.0). 8.10.1 is the only one of those three with the 101 error. |
Hmm, the script doesn't error for me (Windows, cURL 8.10.1, but PHP master branch). That needs further investigation. |
That's interesting. I tested on Windows 10 and in a GitLab CI with Alpine 3.20.2 (with cURL 8.9) and Alpine 3.20.3 (with cURL 8.10.1). I believed that would be independent enough to say that it is a platform independent problem. |
Did a little investigation based on PHP's official docker images and the exact same script as in the original post^^:
|
The point is not really the cURL version (unless it's older than 8.8.0), but whether ECH is enabled by the build; apparently, CMake builds have an option Since ext/curl does not support It seems to me that we need to add support for |
I agree to everything you have said, but just to be clear:
With the |
I think this is working as expected. You are not supposed to use $error = curl_getinfo($curl, CURLINFO_OS_ERRNO); CURLINFO_OS_ERRNO libcurl doc has this note:
The The correct way to determine and get the error message is: $error = curl_errno($curl);
if ($error !== CURLE_OK) {
echo $error.' "'.curl_strerror($error).'"'.PHP_EOL;
} |
@Ayesh Thank you very much for the clarification! When I replace Nevertheless, ECH support is still desirable. |
Still, I do not understand where the |
I spent some time debugging this through, and I think I can explain this behavior. For background, Curl attempts to connect to a server over IPv6 or IPv4. On a machine that does not have IPv6, if Curl attempted to connect to the server over IPv6, the socket fails with an It just happens that If you try this, $curl = curl_init('https://php.net');
curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_exec($curl);
$error = curl_getinfo($curl, CURLINFO_OS_ERRNO); // 0
echo $error.' "'.curl_strerror($error).'"'.PHP_EOL; // 0 (I don't think this is a bug in Curl either; Curl indeed had an |
Thank you @Ayesh – that makes perfect sense. |
Think we can close this? |
We do not yet support |
Ah right, thank you. I thought this was more of a bug report for |
Thank you @Ayesh! And indeed, it will certainly take a while for OpenSSL to catch up. But even if we can't/won't test it in CI, it still might make sense to add support. |
Description
Not sure, if this is really a bug. It is more like a question if this is a bug
The following code:
Resulted in this output (with cURL >=8.10):
But I expected this output instead (with cURL <8.10):
Seems like a cURL issue and not an issue with the wrapper, but cURL provides the
CURLOPT_ECH
to configure it, which the PHP wrapper does not. So I am a bit stuck. Do I have to treat errors differently depending on the cURL version I use or is there any possibility to configure the behavior here?The
CURLOPT_ECH
documentation (see above) says the default setting is off, which does not seem to be true here. Is this an issue with cURL or with the wrapper changing the default somehow?PHP Version
PHP 8.3.12
Operating System
No response
The text was updated successfully, but these errors were encountered: