Skip to content

Commit 63f4e2d

Browse files
feature: add support for nginx-1.29.2.
1 parent 9134bcd commit 63f4e2d

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

‎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 <pluknet@nginx.com>
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)