bug #36422 [HttpClient] fix HTTP/2 support on non-SSL connections - CurlHttpClient only (nicolas-grekas)
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] fix HTTP/2 support on non-SSL connections - CurlHttpClient only
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix #36419
| License | MIT
| Doc PR | -
Commits
-------
a5b884cd94
[HttpClient] fix HTTP/2 support on non-SSL connections - CurlHttpClient only
This commit is contained in:
commit
f84592ac83
@ -141,12 +141,12 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface,
|
|||||||
CURLOPT_CERTINFO => $options['capture_peer_cert_chain'],
|
CURLOPT_CERTINFO => $options['capture_peer_cert_chain'],
|
||||||
];
|
];
|
||||||
|
|
||||||
if (1.0 === (float) $options['http_version']) {
|
if (\defined('CURL_VERSION_HTTP2') && (CURL_VERSION_HTTP2 & self::$curlVersion['features']) && ('https:' === $scheme || 2.0 === (float) $options['http_version'])) {
|
||||||
$curlopts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;
|
|
||||||
} elseif (1.1 === (float) $options['http_version'] || 'https:' !== $scheme) {
|
|
||||||
$curlopts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1;
|
|
||||||
} elseif (\defined('CURL_VERSION_HTTP2') && CURL_VERSION_HTTP2 & self::$curlVersion['features']) {
|
|
||||||
$curlopts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0;
|
$curlopts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_2_0;
|
||||||
|
} elseif (1.0 === (float) $options['http_version']) {
|
||||||
|
$curlopts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;
|
||||||
|
} elseif (1.1 === (float) $options['http_version']) {
|
||||||
|
$curlopts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($options['auth_ntlm'])) {
|
if (isset($options['auth_ntlm'])) {
|
||||||
|
Reference in New Issue
Block a user