Skip to content

Commit 05b0968

Browse files
committed
Part merge of r1919524 from trunk:
CI: Fix OpenSSL tarball download URLs after openssl.org site refresh CI: Build OpenSSL with RPATH set so that the installed ./bin/openssl works without LD_LIBRARY_PATH set. Use LD_RUN_PATH during the httpd build to achieve the same with binaries from the httpd build, but unset it after so that it doesn't affect running e.g. php-fpm or perl later. Should fix warning from logs when php-fpm is executed -- [26-Jul-2024 07:43:34] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library 'curl.so' (tried: /usr/lib/php/20210902/curl.so (/lib/x86_64-linux-gnu/libcurl.so.4: undefined symbol: ENGINE_init, version OPENSSL_3.0.0), /usr/lib/php/20210902/curl.so.so (/usr/lib/php/20210902/curl.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 CI: Test that php-fpm works if available before testing. CI: For paranoia/future debugging, log the OpenSSL version from compile-time and run-time as reported by mod_ssl. (cherry picked from commit 4eee244)
1 parent 053a9cc commit 05b0968

2 files changed

Lines changed: 28 additions & 3 deletions

File tree

test/travis_before_linux.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,13 @@ if test -v TEST_OPENSSL3; then
154154

155155
mkdir -p build/openssl
156156
pushd build/openssl
157-
curl "https://www.openssl.org/source/openssl-${TEST_OPENSSL3}.tar.gz" |
157+
curl -L "https://github.com/openssl/openssl/releases/download/openssl-${TEST_OPENSSL3}/openssl-${TEST_OPENSSL3}.tar.gz" |
158158
tar -xzf -
159159
cd openssl-${TEST_OPENSSL3}
160-
./Configure --prefix=$HOME/root/openssl3 shared no-tests ${OPENSSL_CONFIG}
160+
# Build with RPATH so ./bin/openssl doesn't require $LD_LIBRARY_PATH
161+
./Configure --prefix=$HOME/root/openssl3 \
162+
shared no-tests ${OPENSSL_CONFIG} \
163+
'-Wl,-rpath=$(LIBRPATH)'
161164
make $MFLAGS
162165
make install_sw
163166
touch $HOME/root/openssl-is-${TEST_OPENSSL3}

test/travis_run_linux.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ fi
6161

6262
if test -v TEST_OPENSSL3; then
6363
CONFIG="$CONFIG --with-ssl=$HOME/root/openssl3"
64-
export LD_LIBRARY_PATH=$HOME/root/openssl3/lib:$HOME/root/openssl3/lib64
64+
# Temporarily set LD_RUN_PATH so that httpd/mod_ssl binaries pick
65+
# up the custom OpenSSL build
66+
export LD_RUN_PATH=$HOME/root/openssl3/lib:$HOME/root/openssl3/lib64
6567
export PATH=$HOME/root/openssl3/bin:$PATH
6668
openssl version
6769
fi
@@ -76,6 +78,14 @@ fi
7678
$srcdir/configure --prefix=$PREFIX $CONFIG
7779
make $MFLAGS
7880

81+
if test -v TEST_OPENSSL3; then
82+
# Clear the library/run paths so that anything else run during
83+
# testing is not forced to use the custom OpenSSL build; e.g. perl,
84+
# php-fpm, ...
85+
unset LD_LIBRARY_PATH
86+
unset LD_RUN_PATH
87+
fi
88+
7989
if test -v TEST_INSTALL; then
8090
make install
8191
pushd $PREFIX
@@ -117,6 +127,11 @@ if test -v TEST_ASAN; then
117127
export ASAN_OPTIONS="log_path=$PWD/asan.log:detect_leaks=0"
118128
fi
119129

130+
if test -v PHP_FPM; then
131+
# Sanity test the executable exists.
132+
$PHP_FPM --version
133+
fi
134+
120135
# Try to keep all potential coredumps from all processes
121136
sudo sysctl -w kernel.core_uses_pid=1 2>/dev/null || true
122137
# Systemd based systems might process core dumps via systemd-coredump.
@@ -157,6 +172,13 @@ if test $RV -eq 0 && test -n "`ls test/perl-framework/t/core{,.*} 2>/dev/null`";
157172
RV=4
158173
fi
159174

175+
if test \( -v TEST_SSL -o -v TEST_OPENSSL3 \) \
176+
-a -f test/perl-framework/t/logs/error_log; then
177+
: -- Check OpenSSL version used by mod_ssl at compile- and run-time --
178+
grep 'mod_ssl.*compiled against' test/perl-framework/t/logs/error_log | tail -n1 | grep --color=always 'OpenSSL/[^ ]*'
179+
grep 'resuming normal operations' test/perl-framework/t/logs/error_log | tail -n1 | grep --color=always 'OpenSSL/[^ ]*'
180+
fi
181+
160182
if test -v TEST_SSL -a $RV -eq 0; then
161183
pushd test/perl-framework
162184
# Test loading encrypted private keys

0 commit comments

Comments
 (0)