Skip to content

Commit a8b59a5

Browse files
authored
feature: upgrade nginx core to 1.25.1.
1 parent 2673642 commit a8b59a5

File tree

5 files changed

+65
-8
lines changed

5 files changed

+65
-8
lines changed

.travis.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ env:
4545
- TEST_NGINX_RANDOMIZE=1
4646
- LUACHECK_VER=0.21.1
4747
matrix:
48+
- NGINX_VERSION=1.25.1 OPENSSL_VER=1.1.1u OPENSSL_PATCH_VER=1.1.1f
4849
- NGINX_VERSION=1.21.4 OPENSSL_VER=1.1.1u OPENSSL_PATCH_VER=1.1.1f
4950

5051
services:
@@ -99,7 +100,12 @@ script:
99100
- export LD_LIBRARY_PATH=$PWD/mockeagain:$LD_LIBRARY_PATH
100101
- export TEST_NGINX_RESOLVER=8.8.4.4
101102
- export NGX_BUILD_CC=$CC
102-
- ngx-build $NGINX_VERSION --with-ipv6 --with-http_realip_module --with-http_ssl_module --with-pcre-jit --with-cc-opt="-I$OPENSSL_INC -I$PCRE_INC" --with-ld-opt="-L$OPENSSL_LIB -Wl,-rpath,$OPENSSL_LIB -L$PCRE_LIB -Wl,-rpath,$PCRE_LIB" --add-module=../ndk-nginx-module --add-module=../echo-nginx-module --add-module=../set-misc-nginx-module --add-module=../headers-more-nginx-module --add-module=../lua-nginx-module --with-debug --with-stream_ssl_module --with-stream --with-ipv6 --add-module=../stream-lua-nginx-module > build.log 2>&1 || (cat build.log && exit 1)
103+
- export add_http3_module=--with-http_v3_module
104+
- export disable_pcre2=--without-pcre2
105+
- answer=`util/ver-ge "$NGINX_VERSION" 1.25.1`
106+
- if [ "$OPENSSL_VER" = "1.1.0l" ] || [ "$answer" = "N" ]; then add_http3_module=""; fi
107+
- if [ "$answer" = "N" ]; then disable_pcre2=""; fi
108+
- ngx-build $NGINX_VERSION --with-ipv6 $disable_pcre2 $add_http3_module --with-http_realip_module --with-http_ssl_module --with-pcre-jit --with-cc-opt="-I$OPENSSL_INC -I$PCRE_INC" --with-ld-opt="-L$OPENSSL_LIB -Wl,-rpath,$OPENSSL_LIB -L$PCRE_LIB -Wl,-rpath,$PCRE_LIB" --add-module=../ndk-nginx-module --add-module=../echo-nginx-module --add-module=../set-misc-nginx-module --add-module=../headers-more-nginx-module --add-module=../lua-nginx-module --with-debug --with-stream_ssl_module --with-stream --with-ipv6 --add-module=../stream-lua-nginx-module > build.log 2>&1 || (cat build.log && exit 1)
103109
- nginx -V
104110
- ldd `which nginx`|grep -E 'luajit|ssl|pcre'
105111
- prove -I. -Itest-nginx/lib -j$JOBS -r t

t/ctx.t

+5
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ lua release ngx.ctx at ref 1
379379
}
380380
--- config
381381
lua_ssl_trusted_certificate ../../cert/test.crt;
382+
lua_ssl_protocols TLSv1.2;
382383
383384
location /t {
384385
content_by_lua_block {
@@ -481,6 +482,7 @@ lua release ngx.ctx at ref 1
481482
}
482483
--- config
483484
lua_ssl_trusted_certificate ../../cert/test.crt;
485+
lua_ssl_protocols TLSv1.2;
484486
485487
location /t {
486488
content_by_lua_block {
@@ -535,6 +537,7 @@ lua release ngx.ctx at ref 1
535537
ssl_session_tickets off;
536538
ssl_certificate ../../cert/test.crt;
537539
ssl_certificate_key ../../cert/test.key;
540+
ssl_protocols TLSv1.2;
538541
539542
server_tokens off;
540543
location /foo {
@@ -636,6 +639,7 @@ lua release ngx.ctx at ref 1
636639
ssl_session_tickets off;
637640
ssl_certificate ../../cert/test.crt;
638641
ssl_certificate_key ../../cert/test.key;
642+
ssl_protocols TLSv1.2;
639643
640644
server_tokens off;
641645
location /foo {
@@ -702,6 +706,7 @@ lua release ngx.ctx at ref 1
702706
ssl_session_tickets off;
703707
ssl_certificate ../../cert/test.crt;
704708
ssl_certificate_key ../../cert/test.key;
709+
ssl_protocols TLSv1.2;
705710
706711
ssl_certificate_by_lua_block {
707712
ngx.ctx.count = ngx.ctx.count and (ngx.ctx.count + 100) or 100

t/ssl-session-fetch.t

+9-7
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ __DATA__
5151
resolver $TEST_NGINX_RESOLVER;
5252
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
5353
lua_ssl_verify_depth 3;
54+
lua_ssl_protocols TLSv1.2;
5455
5556
location /t {
5657
set $port $TEST_NGINX_MEMCACHED_PORT;
@@ -97,7 +98,7 @@ qr/ssl_session_fetch_by_lua\(nginx.conf:\d+\):\d+: session id: [a-fA-f\d]+/s
9798
9899
--- grep_error_log_out eval
99100
[
100-
qr/ssl_session_fetch_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-f\d]+/s,
101+
"",
101102
qr/ssl_session_fetch_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-f\d]+/s,
102103
qr/ssl_session_fetch_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-f\d]+/s,
103104
]
@@ -138,6 +139,7 @@ qr/ssl_session_fetch_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-f\d]+/s,
138139
resolver $TEST_NGINX_RESOLVER;
139140
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
140141
lua_ssl_verify_depth 3;
142+
lua_ssl_protocols TLSv1.2;
141143
142144
location /t {
143145
set $port $TEST_NGINX_MEMCACHED_PORT;
@@ -184,8 +186,7 @@ qr/ssl_session_fetch_by_lua:\d: session size: [a-fA-f\d]+|get session error: bad
184186
185187
--- grep_error_log_out eval
186188
[
187-
'get session error: bad session in lua context
188-
',
189+
"",
189190
'get session error: bad session in lua context
190191
',
191192
'get session error: bad session in lua context
@@ -246,6 +247,7 @@ In practice, never store session in plaintext on persistent storage.
246247
resolver $TEST_NGINX_RESOLVER;
247248
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
248249
lua_ssl_verify_depth 3;
250+
lua_ssl_protocols TLSv1.2;
249251
250252
location /t {
251253
set $port $TEST_NGINX_MEMCACHED_PORT;
@@ -342,6 +344,7 @@ able to carry on and negotiate a new session.
342344
resolver $TEST_NGINX_RESOLVER;
343345
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
344346
lua_ssl_verify_depth 3;
347+
lua_ssl_protocols TLSv1.2;
345348
346349
location /t {
347350
set $port $TEST_NGINX_MEMCACHED_PORT;
@@ -388,10 +391,7 @@ qr/failed to resume session: failed to de-serialize session|ssl_session_(fetch|s
388391
389392
--- grep_error_log_out eval
390393
[
391-
qr/^ssl_session_fetch_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-F\d]+
392-
failed to resume session: failed to de-serialize session
393-
ssl_session_store_by_lua\(nginx.conf:\d+\):5: session id: [a-fA-F\d]+
394-
$/s,
394+
qr/^ssl_session_store_by_lua\(nginx.conf:\d+\):5: session id: [a-fA-F\d]+$/s,
395395
qr/^ssl_session_fetch_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-F\d]+
396396
failed to resume session: failed to de-serialize session
397397
ssl_session_store_by_lua\(nginx.conf:\d+\):5: session id: [a-fA-F\d]+
@@ -440,6 +440,7 @@ $/s,
440440
ssl_session_tickets off;
441441
ssl_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
442442
ssl_certificate_key $TEST_NGINX_CERT_DIR/cert/test.key;
443+
ssl_protocols TLSv1.2;
443444
444445
location / {
445446
content_by_lua_block {
@@ -557,6 +558,7 @@ $/s,
557558
--- config
558559
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
559560
lua_ssl_verify_depth 3;
561+
lua_ssl_protocols TLSv1.2;
560562
561563
location /t {
562564
set $port $TEST_NGINX_MEMCACHED_PORT;

t/ssl-session-store.t

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ __DATA__
4949
resolver $TEST_NGINX_RESOLVER;
5050
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
5151
lua_ssl_verify_depth 3;
52+
lua_ssl_protocols TLSv1.2;
5253
5354
location /t {
5455
set $port $TEST_NGINX_MEMCACHED_PORT;
@@ -121,6 +122,7 @@ qr/ssl_session_store_by_lua\(nginx.conf:\d+\):4: session size: \d+/s
121122
resolver $TEST_NGINX_RESOLVER;
122123
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
123124
lua_ssl_verify_depth 3;
125+
lua_ssl_protocols TLSv1.2;
124126
125127
location /t {
126128
set $port $TEST_NGINX_MEMCACHED_PORT;
@@ -229,6 +231,7 @@ qr/ssl_session_store_by_lua\(nginx.conf:\d+\):4: session id: [a-fA-f\d]+/s
229231
resolver $TEST_NGINX_RESOLVER;
230232
lua_ssl_trusted_certificate $TEST_NGINX_CERT_DIR/cert/test.crt;
231233
lua_ssl_verify_depth 3;
234+
lua_ssl_protocols TLSv1.2;
232235
233236
location /t {
234237
set $port $TEST_NGINX_MEMCACHED_PORT;

util/ver-ge

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env perl
2+
3+
use strict;
4+
use warnings;
5+
6+
sub usage {
7+
die "Usage: $0 <ver1> <ver2>\n";
8+
}
9+
10+
my $a = shift or usage();
11+
my $b = shift or usage();
12+
13+
my @as = split /\./, $a;
14+
my @bs = split /\./, $b;
15+
16+
my $n = @as > @bs ? scalar(@as) : scalar(@bs);
17+
18+
for (my $i = 0; $i < $n; $i++) {
19+
my $x = $as[$i];
20+
my $y = $bs[$i];
21+
22+
if (!defined $x) {
23+
$x = 0;
24+
}
25+
26+
if (!defined $y) {
27+
$y = 0;
28+
}
29+
30+
if ($x > $y) {
31+
print "Y\n";
32+
exit;
33+
34+
} elsif ($x < $y) {
35+
print "N\n";
36+
exit;
37+
}
38+
}
39+
40+
print "Y\n";
41+

0 commit comments

Comments
 (0)