prefer CURL_HTTP_VERSION_2_0 to CURL_HTTP_VERSION_2TLS as it is ok with older libcurl
authorgggeek <giunta.gaetano@gmail.com>
Thu, 26 May 2022 11:06:41 +0000 (11:06 +0000)
committergggeek <giunta.gaetano@gmail.com>
Thu, 26 May 2022 11:06:41 +0000 (11:06 +0000)
src/Client.php
tests/6HTTPTest.php

index 0e4fac5..6c4bc8e 100644 (file)
@@ -894,7 +894,7 @@ class Client
                 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 @@ class Client
                 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;
         }
 
index fa013bb..3ac1948 100644 (file)
@@ -344,7 +344,7 @@ class HTTPTest extends ServerTest
         {
             $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;