Skip to content

Commit a4a8d29

Browse files
committed
bugfix: add HTTP/3 QUIC SSL Lua yield patch macro protection
1 parent 9600893 commit a4a8d29

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ install:
8787
- wget https://github.com/openresty/openresty-deps-prebuild/releases/download/v20230902/boringssl-20230902-x64-focal.tar.gz
8888
- wget https://github.com/openresty/openresty-deps-prebuild/releases/download/v20230902/curl-h3-x64-focal.tar.gz
8989
- git clone https://github.com/openresty/test-nginx.git
90-
- git clone https://github.com/openresty/openresty.git ../openresty
90+
- git clone https://github.com/swananan/openresty.git ../openresty -b add-http3-quic-ssl-lua-yield-patch-protection
9191
- git clone https://github.com/openresty/no-pool-nginx.git ../no-pool-nginx
9292
- git clone https://github.com/openresty/openresty-devel-utils.git
9393
- git clone https://github.com/openresty/mockeagain.git

README.markdown

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2879,6 +2879,8 @@ patches to the standard Nginx core:
28792879

28802880
<https://openresty.org/en/nginx-ssl-patches.html>
28812881

2882+
**Note for HTTP/3 (QUIC) users**: When using this directive with HTTP/3 connections, certain yield operations may fail if the QUIC SSL Lua yield patch is not applied to your OpenSSL installation. OpenResty packages include this patch by default, but if you are building lua-nginx-module separately, you may need to apply the patch manually to ensure proper yield/resume functionality for HTTP/3 connections in SSL Lua phases. The patch can be found at: [nginx-1.27.1-quic_ssl_lua_yield.patch](https://github.com/openresty/openresty/blob/master/patches/nginx/1.27.1/nginx-1.27.1-quic_ssl_lua_yield.patch)
2883+
28822884
This directive was first introduced in the `v0.10.21` release.
28832885

28842886
[Back to TOC](#directives)
@@ -2896,6 +2898,8 @@ Equivalent to [ssl_client_hello_by_lua_block](#ssl_client_hello_by_lua_block), e
28962898

28972899
When a relative path like `foo/bar.lua` is given, they will be turned into the absolute path relative to the `server prefix` path determined by the `-p PATH` command-line option while starting the Nginx server.
28982900

2901+
**Note for HTTP/3 (QUIC) users**: When using this directive with HTTP/3 connections, certain yield operations may fail if the QUIC SSL Lua yield patch is not applied to your OpenSSL installation. OpenResty packages include this patch by default, but if you are building lua-nginx-module separately, you may need to apply the patch manually to ensure proper yield/resume functionality for HTTP/3 connections in SSL Lua phases. The patch can be found at: [nginx-1.27.1-quic_ssl_lua_yield.patch](https://github.com/openresty/openresty/blob/master/patches/nginx/1.27.1/nginx-1.27.1-quic_ssl_lua_yield.patch)
2902+
28992903
This directive was first introduced in the `v0.10.21` release.
29002904

29012905
[Back to TOC](#directives)
@@ -2989,6 +2993,8 @@ patches to the standard Nginx core:
29892993

29902994
<https://openresty.org/en/nginx-ssl-patches.html>
29912995

2996+
**Note for HTTP/3 (QUIC) users**: When using this directive with HTTP/3 connections, certain yield operations may fail if the QUIC SSL Lua yield patch is not applied to your OpenSSL installation. OpenResty packages include this patch by default, but if you are building lua-nginx-module separately, you may need to apply the patch manually to ensure proper yield/resume functionality for HTTP/3 connections in SSL Lua phases. The patch can be found at: [nginx-1.27.1-quic_ssl_lua_yield.patch](https://github.com/openresty/openresty/blob/master/patches/nginx/1.27.1/nginx-1.27.1-quic_ssl_lua_yield.patch)
2997+
29922998
This directive was first introduced in the `v0.10.0` release.
29932999

29943000
[Back to TOC](#directives)
@@ -3006,6 +3012,8 @@ Equivalent to [ssl_certificate_by_lua_block](#ssl_certificate_by_lua_block), exc
30063012

30073013
When a relative path like `foo/bar.lua` is given, they will be turned into the absolute path relative to the `server prefix` path determined by the `-p PATH` command-line option while starting the Nginx server.
30083014

3015+
**Note for HTTP/3 (QUIC) users**: When using this directive with HTTP/3 connections, certain yield operations may fail if the QUIC SSL Lua yield patch is not applied to your OpenSSL installation. OpenResty packages include this patch by default, but if you are building lua-nginx-module separately, you may need to apply the patch manually to ensure proper yield/resume functionality for HTTP/3 connections in SSL Lua phases. The patch can be found at: [nginx-1.27.1-quic_ssl_lua_yield.patch](https://github.com/openresty/openresty/blob/master/patches/nginx/1.27.1/nginx-1.27.1-quic_ssl_lua_yield.patch)
3016+
30093017
This directive was first introduced in the `v0.10.0` release.
30103018

30113019
[Back to TOC](#directives)

src/ngx_http_lua_ssl_certby.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ ngx_http_lua_ssl_cert_done(void *data)
390390

391391
ngx_post_event(c->write, &ngx_posted_events);
392392

393-
#if (NGX_HTTP_V3) && OPENSSL_VERSION_NUMBER >= 0x1000205fL
393+
#if (HAVE_QUIC_SSL_LUA_YIELD_PATCH) && OPENSSL_VERSION_NUMBER >= 0x1000205fL
394394
# if (NGX_QUIC_OPENSSL_COMPAT)
395395
ngx_http_lua_resume_quic_ssl_handshake(c);
396396
# endif

src/ngx_http_lua_ssl_client_helloby.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ ngx_http_lua_ssl_client_hello_done(void *data)
381381

382382
ngx_post_event(c->write, &ngx_posted_events);
383383

384-
#if (NGX_HTTP_V3) && defined(SSL_ERROR_WANT_CLIENT_HELLO_CB)
384+
#if (HAVE_QUIC_SSL_LUA_YIELD_PATCH) && defined(SSL_ERROR_WANT_CLIENT_HELLO_CB)
385385
# if (NGX_QUIC_OPENSSL_COMPAT)
386386
ngx_http_lua_resume_quic_ssl_handshake(c);
387387
# endif

src/ngx_http_lua_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4574,7 +4574,7 @@ ngx_http_lua_ffi_bypass_if_checks(ngx_http_request_t *r)
45744574
}
45754575

45764576

4577-
#if (NGX_HTTP_V3)
4577+
#if (HAVE_QUIC_SSL_LUA_YIELD_PATCH)
45784578
void
45794579
ngx_http_lua_resume_quic_ssl_handshake(ngx_connection_t *c)
45804580
{

src/ngx_http_lua_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ ngx_addr_t *ngx_http_lua_parse_addr(lua_State *L, u_char *text, size_t len);
267267

268268
size_t ngx_http_lua_escape_log(u_char *dst, u_char *src, size_t size);
269269

270-
#if (NGX_HTTP_V3)
270+
#if (HAVE_QUIC_SSL_LUA_YIELD_PATCH)
271271
void ngx_http_lua_resume_quic_ssl_handshake(ngx_connection_t *c);
272272
#endif
273273

0 commit comments

Comments
 (0)