aports/testing/php85/fix-curl.patch
2025-10-08 09:46:31 +00:00

49 lines
1.5 KiB
Diff

Patch-Source: https://github.com/php/php-src/commit/36859ad97753f6d2e550d57823111d91f0ad0ce9
From 36859ad97753f6d2e550d57823111d91f0ad0ce9 Mon Sep 17 00:00:00 2001
From: Jakub Zelenka <bukka@php.net>
Date: Tue, 7 Oct 2025 12:33:26 +0200
Subject: [PATCH] Fix curl_setopt_ssl test for curl 8.16
---
ext/curl/tests/curl_setopt_ssl.phpt | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/ext/curl/tests/curl_setopt_ssl.phpt b/ext/curl/tests/curl_setopt_ssl.phpt
index 11d8fff702a88..ff08528321a0f 100644
--- a/ext/curl/tests/curl_setopt_ssl.phpt
+++ b/ext/curl/tests/curl_setopt_ssl.phpt
@@ -18,9 +18,13 @@ if ($curl_version['version_number'] < 0x074700) {
--FILE--
<?php
-function check_error(CurlHandle $ch) {
+function check_error(CurlHandle $ch, $expected = null) {
if (curl_errno($ch) !== 0) {
- echo "CURL ERROR: " . curl_errno($ch) . "\n";
+ $errno = curl_errno($ch);
+ if (!is_null($expected)) {
+ $errno = $errno == $expected ? 'EXPECTED' : "UNEXPECTED(A:$errno,E:$expected)";
+ }
+ echo "CURL ERROR: " . $errno . "\n";
}
}
@@ -109,7 +113,7 @@ try {
$response = curl_exec($ch);
check_response($response, $clientCertSubject);
- check_error($ch);
+ check_error($ch, curl_version()['version_number'] < 0x081000 ? 58 : 43);
$ch = null;
echo "\n";
@@ -203,7 +207,7 @@ bool(true)
bool(true)
bool(true)
client cert subject not in response
-CURL ERROR: 58
+CURL ERROR: EXPECTED
case 4: client cert and key from file
bool(true)