Skip to content

Commit 06c41ec

Browse files
authored
Run curl_setopt_ssl.phpt on Windows, too (phpGH-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.
1 parent 3992ffa commit 06c41ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/curl/tests/curl_setopt_ssl.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ curl
77
if (!function_exists("proc_open")) die("skip no proc_open");
88
exec('openssl version', $out, $code);
99
if ($code > 0) die("skip couldn't locate openssl binary");
10-
if (PHP_OS_FAMILY === 'Windows') die('skip not for Windows');
10+
1111
if (PHP_OS_FAMILY === 'Darwin') die('skip Fails intermittently on macOS');
1212
if (PHP_OS === 'FreeBSD') die('skip proc_open seems to be stuck on FreeBSD');
1313
$curl_version = curl_version();
@@ -62,7 +62,7 @@ $port = 14430;
6262

6363
// set up local server
6464
$cmd = "openssl s_server -key $serverKeyPath -cert $serverCertPath -accept $port -www -CAfile $clientCertPath -verify_return_error -Verify 1";
65-
$process = proc_open($cmd, [["pipe", "r"], ["pipe", "w"], ["pipe", "w"]], $pipes);
65+
$process = proc_open($cmd, [["pipe", "r"], ["pipe", "w"], ["pipe", "w"]], $pipes, null, null, ["bypass_shell" => true]);
6666

6767
if ($process === false) {
6868
die('failed to start server');

0 commit comments

Comments
 (0)