4
4
5
5
runtime_version=${runtime_version:- 0.0.0}
6
6
7
+
8
+ debug_args=${debug_args:- }
9
+ ENABLE_FIPS=${ENABLE_FIPS:- " false" }
10
+ OPENSSL_CONF_PATH=${OPENSSL_CONF_PATH:- $PWD / conf/ openssl3/ openssl.cnf}
11
+
12
+
13
+ OR_PREFIX=${OR_PREFIX:= " /usr/local/openresty" }
14
+ OPENSSL_PREFIX=${OPENSSL_PREFIX:= $OR_PREFIX / openssl3}
15
+ zlib_prefix=${OR_PREFIX} /zlib
16
+ pcre_prefix=${OR_PREFIX} /pcre
17
+
18
+ cc_opt=${cc_opt:- " -DNGX_LUA_ABORT_AT_PANIC -I$zlib_prefix /include -I$pcre_prefix /include -I$OPENSSL_PREFIX /include" }
19
+ ld_opt=${ld_opt:- " -L$zlib_prefix /lib -L$pcre_prefix /lib -L$OPENSSL_PREFIX /lib -Wl,-rpath,$zlib_prefix /lib:$pcre_prefix /lib:$OPENSSL_PREFIX /lib" }
20
+
21
+
22
+ # dependencies for building openresty
23
+ OPENSSL_VERSION=${OPENSSL_VERSION:- " 3.2.0" }
7
24
OPENRESTY_VERSION=" 1.21.4.2"
8
25
ngx_multi_upstream_module_ver=" 1.1.1"
9
26
mod_dubbo_ver=" 1.0.2"
@@ -12,8 +29,41 @@ wasm_nginx_module_ver="0.6.5"
12
29
lua_var_nginx_module_ver=" v0.5.3"
13
30
grpc_client_nginx_module_ver=" v0.4.4"
14
31
lua_resty_events_ver=" 0.2.0"
15
- OR_PREFIX=${OR_PREFIX:= " /usr/local/openresty" }
16
- debug_args=${debug_args:- }
32
+
33
+
34
+ install_openssl_3 (){
35
+ local fips=" "
36
+ if [ " $ENABLE_FIPS " == " true" ]; then
37
+ fips=" enable-fips"
38
+ fi
39
+ # required for openssl 3.x config
40
+ cpanm IPC/Cmd.pm
41
+ wget --no-check-certificate https://www.openssl.org/source/openssl-${OPENSSL_VERSION} .tar.gz
42
+ tar xvf openssl-${OPENSSL_VERSION} .tar.gz
43
+ cd openssl-${OPENSSL_VERSION} /
44
+ export LDFLAGS=" -Wl,-rpath,$zlib_prefix /lib:$OPENSSL_PREFIX /lib"
45
+ ./config $fips \
46
+ shared \
47
+ zlib \
48
+ enable-camellia enable-seed enable-rfc3779 \
49
+ enable-cms enable-md2 enable-rc5 \
50
+ enable-weak-ssl-ciphers \
51
+ --prefix=$OPENSSL_PREFIX \
52
+ --libdir=lib \
53
+ --with-zlib-lib=$zlib_prefix /lib \
54
+ --with-zlib-include=$zlib_prefix /include
55
+ make -j $( nproc) LD_LIBRARY_PATH= CC=" gcc"
56
+ make install
57
+ if [ -f " $OPENSSL_CONF_PATH " ]; then
58
+ cp " $OPENSSL_CONF_PATH " " $OPENSSL_PREFIX " /ssl/openssl.cnf
59
+ fi
60
+ if [ " $ENABLE_FIPS " == " true" ]; then
61
+ $OPENSSL_PREFIX /bin/openssl fipsinstall -out $OPENSSL_PREFIX /ssl/fipsmodule.cnf -module $OPENSSL_PREFIX /lib/ossl-modules/fips.so
62
+ 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
63
+ fi
64
+ cd ..
65
+ }
66
+
17
67
18
68
if ([ $# -gt 0 ] && [ " $1 " == " latest" ]) || [ " $version " == " latest" ]; then
19
69
debug_args=" --with-debug"
@@ -24,6 +74,9 @@ repo=$(basename "$prev_workdir")
24
74
workdir=$( mktemp -d)
25
75
cd " $workdir " || exit 1
26
76
77
+
78
+ install_openssl_3
79
+
27
80
wget --no-check-certificate https://openresty.org/download/openresty-${OPENRESTY_VERSION} .tar.gz
28
81
tar -zxvpf openresty-${OPENRESTY_VERSION} .tar.gz > /dev/null
29
82
@@ -95,8 +148,7 @@ cd wasm-nginx-module-${wasm_nginx_module_ver} || exit 1
95
148
./install-wasmtime.sh
96
149
cd ..
97
150
98
- cc_opt=${cc_opt:- }
99
- ld_opt=${ld_opt:- }
151
+
100
152
luajit_xcflags=${luajit_xcflags:= " -DLUAJIT_NUMMODE=2 -DLUAJIT_ENABLE_LUA52COMPAT" }
101
153
no_pool_patch=${no_pool_patch:- }
102
154
# TODO: remove old NGX_HTTP_GRPC_CLI_ENGINE_PATH once we have released a new
126
178
mv lua-resty-limit-traffic-$limit_ver bundle/lua-resty-limit-traffic-$or_limit_ver
127
179
fi
128
180
181
+
129
182
./configure --prefix=" $OR_PREFIX " \
130
183
--with-cc-opt=" -DAPISIX_RUNTIME_VER=$runtime_version $grpc_engine_path $cc_opt " \
131
184
--with-ld-opt=" -Wl,-rpath,$OR_PREFIX /wasmtime-c-api/lib $ld_opt " \
0 commit comments