From 9b9edb662547e29dfab4ff38e05306feaa56e46f Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 4 Nov 2022 19:39:07 +0100 Subject: [PATCH] Fix GH-9890: OpenSSL legacy providers not available on Windows We need to copy the provider DLLs from the dependency package to the PHP distribution. --- win32/build/mkdist.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/win32/build/mkdist.php b/win32/build/mkdist.php index 8ae3926b652b1..58453b062ddd0 100644 --- a/win32/build/mkdist.php +++ b/win32/build/mkdist.php @@ -357,6 +357,22 @@ function extract_file_from_tarball($pkg, $filename, $dest_dir) /* {{{ */ } } +$OPENSSL_DLLS = $php_build_dir . "/lib/ossl-modules/*.dll"; +$fls = glob($OPENSSL_DLLS); +if (!empty($fls)) { + $openssl_dest_dir = "$dist_dir/extras/ssl"; + if (!file_exists($openssl_dest_dir) || !is_dir($openssl_dest_dir)) { + if (!mkdir($openssl_dest_dir, 0777, true)) { + echo "WARNING: couldn't create '$openssl_dest_dir' for OpenSSL providers "; + } + } + foreach ($fls as $fl) { + if (!copy($fl, "$openssl_dest_dir/" . basename($fl))) { + echo "WARNING: couldn't copy $fl into the $openssl_dest_dir"; + } + } +} + $SASL_DLLS = $php_build_dir . "/bin/sasl2/sasl*.dll"; $fls = glob($SASL_DLLS); if (!empty($fls)) {