From 267e4e6b608f05474a162b87933040160d35387c Mon Sep 17 00:00:00 2001 From: gggeek Date: Thu, 26 May 2022 11:06:41 +0000 Subject: [PATCH] prefer CURL_HTTP_VERSION_2_0 to CURL_HTTP_VERSION_2TLS as it is ok with older libcurl --- src/Client.php | 4 ++-- tests/6HTTPTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Client.php b/src/Client.php index 0e4fac51..6c4bc8eb 100644 --- a/src/Client.php +++ b/src/Client.php @@ -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']); @@ -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; } diff --git a/tests/6HTTPTest.php b/tests/6HTTPTest.php index fa013bbf..3ac19486 100644 --- a/tests/6HTTPTest.php +++ b/tests/6HTTPTest.php @@ -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;