Skip to content

Commit 6d7b30d

Browse files
add back openssl3 installation block
1 parent d1558bb commit 6d7b30d

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

build-apisix-runtime.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,41 @@ wasm_nginx_module_ver="0.7.0"
2929
lua_var_nginx_module_ver="v0.5.3"
3030
lua_resty_events_ver="0.2.0"
3131

32+
33+
install_openssl_3(){
34+
local fips=""
35+
if [ "$ENABLE_FIPS" == "true" ]; then
36+
fips="enable-fips"
37+
fi
38+
# required for openssl 3.x config
39+
cpanm IPC/Cmd.pm
40+
wget --no-check-certificate https://github.com/openssl/openssl/releases/download/openssl-3.2.0/openssl-${OPENSSL_VERSION}.tar.gz
41+
tar xvf openssl-${OPENSSL_VERSION}.tar.gz
42+
cd openssl-${OPENSSL_VERSION}/
43+
export LDFLAGS="-Wl,-rpath,$zlib_prefix/lib:$OPENSSL_PREFIX/lib"
44+
./config $fips \
45+
shared \
46+
zlib \
47+
enable-camellia enable-seed enable-rfc3779 \
48+
enable-cms enable-md2 enable-rc5 \
49+
enable-weak-ssl-ciphers \
50+
--prefix=$OPENSSL_PREFIX \
51+
--libdir=lib \
52+
--with-zlib-lib=$zlib_prefix/lib \
53+
--with-zlib-include=$zlib_prefix/include
54+
make -j $(nproc) LD_LIBRARY_PATH= CC="gcc"
55+
sudo make install
56+
if [ -f "$OPENSSL_CONF_PATH" ]; then
57+
sudo cp "$OPENSSL_CONF_PATH" "$OPENSSL_PREFIX"/ssl/openssl.cnf
58+
fi
59+
if [ "$ENABLE_FIPS" == "true" ]; then
60+
$OPENSSL_PREFIX/bin/openssl fipsinstall -out $OPENSSL_PREFIX/ssl/fipsmodule.cnf -module $OPENSSL_PREFIX/lib/ossl-modules/fips.so
61+
sudo sed -i 's@# .include [email protected] '"$OPENSSL_PREFIX"'/ssl/fipsmodule.cnf@g; s/# \(fips = fips_sect\)/\1\nbase = base_sect\n\n[base_sect]\nactivate=1\n/g' $OPENSSL_PREFIX/ssl/openssl.cnf
62+
fi
63+
cd ..
64+
}
65+
66+
3267
if ([ $# -gt 0 ] && [ "$1" == "latest" ]) || [ "$runtime_version" == "0.0.0" ]; then
3368
debug_args="--with-debug"
3469
fi
@@ -39,6 +74,8 @@ workdir=$(mktemp -d)
3974
cd "$workdir" || exit 1
4075

4176

77+
install_openssl_3
78+
4279
wget --no-check-certificate https://openresty.org/download/openresty-${OPENRESTY_VERSION}.tar.gz
4380
tar -zxvpf openresty-${OPENRESTY_VERSION}.tar.gz > /dev/null
4481

0 commit comments

Comments
 (0)