Recent versions of cURL default to HTTP/2 where the server supports HTTP/2:
$ curl --verbose https://www.google.com/ ... > GET / HTTP/2
However, back in my day, we could type our HTTP requests by hand and we liked it that way. If serial transmission of messages was good enough for us, why should these new grads with their fancy degrees and their USB vape pen / fidget spinners doohickeys get anything different?
Also, libcurl just can't talk to HTTP/2 proxies, so if you hit an HTTP/2 proxy you're dead in the water, and all Google properties are reportedly a giant HTTP proxy that upgrades HTTP to HTTP/2 to QUIC-over-UDP to proprietary Google PWM signals running over proprietary Google wires on proprietary Google silicon.
https://github.com/curl/curl/issues/3570
It's unlikely we get anything by using HTTP/2 for any of our requests (generally, we are not limited by connections, and can resolve connection congestion effects in the rare cases where we may be by opening more connections), and unlikely that HTTP/1.1 is going away any time soon -- just as HTTP/1.0 still works fine everywhere today, over a thousand years after HTTP/1.1 was RFC'd. Support for HTTP/2 may be desirable some day but that day is likely far away.
The proposed patch is:
diff --git a/src/future/http/HTTPSFuture.php b/src/future/http/HTTPSFuture.php index 0064a8f..9409d93 100644 --- a/src/future/http/HTTPSFuture.php +++ b/src/future/http/HTTPSFuture.php @@ -206,6 +206,7 @@ final class HTTPSFuture extends BaseHTTPFuture { curl_multi_add_handle(self::$multi, $curl); curl_setopt($curl, CURLOPT_URL, $uri); + curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); if (defined('CURLOPT_PROTOCOLS')) { // cURL supports a lot of protocols, and by default it will honor
Some version of this is likely reasonable, but I want to make sure CURL_HTTP_VERSION_1_1 is available in very old versions of cURL/PHP first.