Skip to content

Commit b088d7f

Browse files
feature: add support for nginx-1.29.2.
1 parent a9addfa commit b088d7f

File tree

3 files changed

+52
-11
lines changed

3 files changed

+52
-11
lines changed

.travis.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ env:
2828
- LD_LIBRARY_PATH=$LUAJIT_LIB:$LD_LIBRARY_PATH
2929
- LUAJIT_INC=$LUAJIT_PREFIX/include/luajit-2.1
3030
- LUA_INCLUDE_DIR=$LUAJIT_INC
31-
- PCRE2_VER=10.45
32-
#- PCRE2_PREFIX=/opt/pcre2
33-
- PCRE2_PREFIX=/usr/local/openresty/pcre2
31+
- PCRE2_VER=10.46
32+
- PCRE2_PREFIX=/opt/pcre2
33+
#- PCRE2_PREFIX=/usr/local/openresty/pcre2
3434
- PCRE2_LIB=$PCRE2_PREFIX/lib
3535
- PCRE2_INC=$PCRE2_PREFIX/include
36-
#- OPENSSL_PREFIX=/opt/ssl3
37-
- OPENSSL_PREFIX=/usr/local/openresty/openssl3
36+
- OPENSSL_PREFIX=/opt/ssl3
37+
#- OPENSSL_PREFIX=/usr/local/openresty/openssl3
3838
- OPENSSL_LIB=$OPENSSL_PREFIX/lib
3939
- OPENSSL_INC=$OPENSSL_PREFIX/include
4040
- JOBS=3
4141
- NGX_BUILD_JOBS=$JOBS
4242
- TEST_NGINX_SLEEP=0.006
4343
matrix:
44-
- NGINX_VERSION=1.27.1 OPENSSL_VER=3.5.0
44+
- NGINX_VERSION=1.29.2 OPENSSL_VER=3.5.4
4545

4646
services:
4747
- memcache
@@ -54,8 +54,8 @@ before_install:
5454
- sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends openresty-pcre2 openresty-openssl3 openresty-pcre2-dev openresty-openssl3-dev
5555

5656
install:
57-
#- if [ ! -f download-cache/pcre2-$PCRE2_VER.tar.gz ]; then wget -P download-cache https://downloads.sourceforge.net/project/pcre/pcre2/${PCRE2_VER}/pcre2-${PCRE2_VER}.tar.gz; fi
58-
#- if [ ! -f download-cache/openssl-$OPENSSL_VER.tar.gz ]; then wget -P download-cache https://www.openssl.org/source/openssl-$OPENSSL_VER.tar.gz; fi
57+
- if [ ! -f download-cache/pcre2-$PCRE2_VER.tar.gz ]; then wget -P download-cache https://downloads.sourceforge.net/project/pcre/pcre2/${PCRE2_VER}/pcre2-${PCRE2_VER}.tar.gz; fi
58+
- if [ ! -f download-cache/openssl-$OPENSSL_VER.tar.gz ]; then wget -P download-cache https://www.openssl.org/source/openssl-$OPENSSL_VER.tar.gz; fi
5959
- git clone https://github.com/openresty/openresty-devel-utils.git
6060
- git clone https://github.com/openresty/lua-cjson.git
6161
- git clone https://github.com/openresty/openresty.git ../openresty
@@ -78,14 +78,14 @@ script:
7878
- sudo ip addr add 10.254.254.1/24 dev lo
7979
- sudo ip addr add 10.254.254.2/24 dev lo
8080
- sudo ip route add prohibit 0.0.0.1/32
81-
#- tar zxf download-cache/pcre2-$PCRE2_VER.tar.gz; cd pcre2-$PCRE2_VER/; ./configure --prefix=$PCRE2_PREFIX --enable-jit --enable-utf > build.log 2>&1 || (cat build.log && exit 1); make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1); sudo PATH=$PATH make install > build.log 2>&1 || (cat build.log && exit 1); cd ..;
81+
- tar zxf download-cache/pcre2-$PCRE2_VER.tar.gz; cd pcre2-$PCRE2_VER/; ./configure --prefix=$PCRE2_PREFIX --enable-jit --enable-utf > build.log 2>&1 || (cat build.log && exit 1); make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1); sudo PATH=$PATH make install > build.log 2>&1 || (cat build.log && exit 1); cd ..;
8282
- cd luajit2
8383
- make -j$JOBS CCDEBUG=-g Q= PREFIX=$LUAJIT_PREFIX CC=$CC XCFLAGS='-DLUA_USE_APICHECK -DLUA_USE_ASSERT' > build.log 2>&1 || (cat build.log && exit 1)
8484
- sudo make install PREFIX=$LUAJIT_PREFIX > build.log 2>&1 || (cat build.log && exit 1)
8585
- cd ../test-nginx && sudo cpanm . && cd ..
8686
- cd lua-cjson/ && make -j$JOBS && sudo make install && cd ..
8787
- cd mockeagain/ && make CC=$CC -j$JOBS && cd ..
88-
#- tar zxf download-cache/openssl-$OPENSSL_VER.tar.gz; cd openssl-$OPENSSL_VER/; ./config no-threads shared enable-ssl3 enable-ssl3-method -g --prefix=$OPENSSL_PREFIX -DPURIFY > build.log 2>&1 || (cat build.log && exit 1); make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1); sudo make PATH=$PATH install_sw > build.log 2>&1 || (cat build.log && exit 1) ; cd ..
88+
- tar zxf download-cache/openssl-$OPENSSL_VER.tar.gz; cd openssl-$OPENSSL_VER/; ./config no-threads shared enable-ssl3 enable-ssl3-method -g --prefix=$OPENSSL_PREFIX -DPURIFY > build.log 2>&1 || (cat build.log && exit 1); make -j$JOBS > build.log 2>&1 || (cat build.log && exit 1); sudo make PATH=$PATH install_sw > build.log 2>&1 || (cat build.log && exit 1) ; cd ..
8989
- export PATH=$PWD/work/nginx/sbin:$PWD/openresty-devel-utils:$PATH
9090
- export NGX_BUILD_CC=$CC
9191
- sh util/build.sh $NGINX_VERSION > build.log 2>&1 || (cat build.log && exit 1)

src/ngx_stream_lua_ssl_client_helloby.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,15 @@ ngx_stream_lua_ssl_client_hello_handler(ngx_ssl_conn_t *ssl_conn,
218218
return -1;
219219
}
220220

221+
#if (nginx_version > 1029000)
222+
/* see commit 0373fe5d98c1515640 for more details */
223+
rc = ngx_ssl_client_hello_callback(ssl_conn, al, arg);
224+
225+
if (rc == 0) {
226+
return rc;
227+
}
228+
#endif
229+
221230
dd("first time");
222231

223232
ngx_reusable_connection(c, 0);

t/129-ssl-socket.t

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2769,6 +2769,37 @@ SSL reused session
27692769

27702770
=== TEST 35: ssl session/ticket reuse CVE
27712771
https://www.cve.org/CVERecord?id=CVE-2025-23419
2772+
2773+
commit 0373fe5d98c1515640e74fa6f4d32fac1f1d3ab2
2774+
Author: Sergey Kandaurov <[email protected]>
2775+
Date: Tue Jan 28 00:53:15 2025 +0400
2776+
2777+
SNI: using the ClientHello callback.
2778+
2779+
The change introduces an SNI based virtual server selection during
2780+
early ClientHello processing. The callback is available since
2781+
OpenSSL 1.1.1; for older OpenSSL versions, the previous behaviour
2782+
is kept.
2783+
2784+
Using the ClientHello callback sets a reasonable processing order
2785+
for the "server_name" TLS extension. Notably, session resumption
2786+
decision now happens after applying server configuration chosen by
2787+
SNI, useful with enabled verification of client certificates, which
2788+
brings consistency with BoringSSL behaviour. The change supersedes
2789+
and reverts a fix made in 46b9f5d38 for TLSv1.3 resumed sessions.
2790+
2791+
In addition, since the callback is invoked prior to the protocol
2792+
version negotiation, this makes it possible to set "ssl_protocols"
2793+
on a per-virtual server basis.
2794+
2795+
To keep the $ssl_server_name variable working with TLSv1.2 resumed
2796+
sessions, as previously fixed in fd97b2a80, a limited server name
2797+
callback is preserved in order to acknowledge the extension.
2798+
2799+
Note that to allow third-party modules to properly chain the call to
2800+
ngx_ssl_client_hello_callback(), the servername callback function is
2801+
passed through exdata.
2802+
--- SKIP
27722803
--- stream_config
27732804
server {
27742805
listen $TEST_NGINX_SERVER_SSL_PORT ssl reuseport default_server;
@@ -2907,6 +2938,8 @@ lua ssl free session
29072938

29082939
=== TEST 36: ssl session/ticket reuse CVE
29092940
https://www.cve.org/CVERecord?id=CVE-2025-23419
2941+
see TEST 35
2942+
--- SKIP
29102943
--- main_config
29112944
env PATH;
29122945
--- stream_config
@@ -3011,7 +3044,6 @@ handshake rejected while SSL handshaking
30113044
[alert]
30123045
[crit]
30133046
--- timeout: 5
3014-
--- skip_nginx: 7: < 1.25.4
30153047

30163048

30173049

0 commit comments

Comments
 (0)