[php-src] PR #14578: Enable native SSL support in ext/phar
| From: | petk | Date: | Sat, 15 Jun 2024 23:55:30 +0000 |
| Subject: | [php-src] PR #14578: Enable native SSL support in ext/phar | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-26701@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/14578
Author: petk
SSL support in ext/phar is enabled either as native (using the system's OpenSSL and its Crypto
library linked directly) or as a wrapper provided by ext/openssl.
Native OpenSSL support previously couldn't be enabled when building with shared openssl
extension:
./configure --with-openssl=shared --enable-phar=shared
or:
./configure --with-openssl=shared --enable-phar
Some PHP packages build both of these extensions as shared and it makes sense to provide native
OpenSSL support in ext/phar also when ext/openssl is build as shared.
Shared phar extension with native OpenSSL enabled now gets libcrypto linked directly:
ldd modules/phar.so
linux-vdso.so.1
libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
/lib64/ld-linux-x86-64.so.2
The new --with-phar-ssl Autotools configure option enables the SSL support in phar when building
without openssl extension or in edge cases when building with phpize. Windows already includes
similar option (--enable-phar-native-ssl):
./configure --with-phar --with-phar-ssl --without-openssl
Changed tests:
- ext/phar/tests/**/phar_setsignaturealgo2.phpt - needs ext/openssl enabled due to
openssl_get_privatekey().
- ext/phar/tests/phar_setsignaturealgo.phpt - test for ext/phar with native OpenSSL support and
ext/openssl disabled.