Skip to content

Commit

Permalink
prefer CURL_HTTP_VERSION_2_0 to CURL_HTTP_VERSION_2TLS as it is ok wi…
Browse files Browse the repository at this point in the history
…th older libcurl
  • Loading branch information
gggeek committed May 26, 2022
1 parent 09dbc14 commit 267e4e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ protected function sendPayloadCURL($req, $server, $port, $timeout = 0, $username
return new Response(0, PhpXmlRpc::$xmlrpcerr['no_ssl'], PhpXmlRpc::$xmlrpcstr['no_ssl']);
}
}
if (($method == 'http2tls' && !defined('CURL_HTTP_VERSION_2TLS')) ||
if (($method == 'http2tls' && !defined('CURL_HTTP_VERSION_2_0')) ||
($method == 'http2' && !defined('CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE'))) {
$this->errstr = 'HTTP/2 unavailable on this install';
return new Response(0, PhpXmlRpc::$xmlrpcerr['no_http2'], PhpXmlRpc::$xmlrpcstr['no_http2']);
Expand Down Expand Up @@ -1014,7 +1014,7 @@ protected function sendPayloadCURL($req, $server, $port, $timeout = 0, $username
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE);
break;
case 'http2tls':
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);
curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
break;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/6HTTPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public function testHttp2tls($method)
{
$this->markTestSkipped('HTTPS SERVER definition missing: cannot test http/2 tls');
return;
} else if (!defined('CURL_HTTP_VERSION_2TLS'))
} else if (!defined('CURL_HTTP_VERSION_2_0'))
{
$this->markTestSkipped('CURL http/2 support missing: cannot test http/2 tls');
return;
Expand Down

0 comments on commit 267e4e6

Please sign in to comment.