From 06c41ec6c54a2b6d79d91976041ef12241550683 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Tue, 28 Jan 2025 01:14:10 +0100 Subject: [PATCH] Run curl_setopt_ssl.phpt on Windows, too (GH-16086) The whole point of using `proc_open()` to execute `openssl s_client` is that we can terminate the process when we're done. However, when going through the shell on Windows, we get a handle to the shell process, and if we terminate that, the grandchild will stay open. Since the pipes of the grandchild will stay open, the PHP process will not terminate either, so the test stalls. We solve this by simply bypassing the shell. --- ext/curl/tests/curl_setopt_ssl.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/curl/tests/curl_setopt_ssl.phpt b/ext/curl/tests/curl_setopt_ssl.phpt index 11d8fff702a88..3f345930f6244 100644 --- a/ext/curl/tests/curl_setopt_ssl.phpt +++ b/ext/curl/tests/curl_setopt_ssl.phpt @@ -7,7 +7,7 @@ curl if (!function_exists("proc_open")) die("skip no proc_open"); exec('openssl version', $out, $code); if ($code > 0) die("skip couldn't locate openssl binary"); -if (PHP_OS_FAMILY === 'Windows') die('skip not for Windows'); + if (PHP_OS_FAMILY === 'Darwin') die('skip Fails intermittently on macOS'); if (PHP_OS === 'FreeBSD') die('skip proc_open seems to be stuck on FreeBSD'); $curl_version = curl_version(); @@ -62,7 +62,7 @@ $port = 14430; // set up local server $cmd = "openssl s_server -key $serverKeyPath -cert $serverCertPath -accept $port -www -CAfile $clientCertPath -verify_return_error -Verify 1"; -$process = proc_open($cmd, [["pipe", "r"], ["pipe", "w"], ["pipe", "w"]], $pipes); +$process = proc_open($cmd, [["pipe", "r"], ["pipe", "w"], ["pipe", "w"]], $pipes, null, null, ["bypass_shell" => true]); if ($process === false) { die('failed to start server');