-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(patch): add
tls.disable_http2_alpn()
function needed patch for…
- Loading branch information
Showing
3 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
build/openresty/patches/ngx_lua-0.10.26_01-ssl-disable-h2-alpn.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
diff --git a/bundle/nginx-1.25.3/src/http/modules/ngx_http_ssl_module.c b/bundle/nginx-1.25.3/src/http/modules/ngx_http_ssl_module.c | ||
index 1c92d9f..232a279 100644 | ||
--- a/bundle/nginx-1.25.3/src/http/modules/ngx_http_ssl_module.c | ||
+++ b/bundle/nginx-1.25.3/src/http/modules/ngx_http_ssl_module.c | ||
@@ -8,6 +8,9 @@ | ||
#include <ngx_config.h> | ||
#include <ngx_core.h> | ||
#include <ngx_http.h> | ||
+#if (NGX_HTTP_LUA_KONG) | ||
+#include <ngx_http_lua_kong_module.h> | ||
+#endif | ||
|
||
#if (NGX_QUIC_OPENSSL_COMPAT) | ||
#include <ngx_event_quic_openssl_compat.h> | ||
@@ -473,8 +476,11 @@ ngx_http_ssl_alpn_select(ngx_ssl_conn_t *ssl_conn, const unsigned char **out, | ||
{ | ||
#if (NGX_HTTP_V2) | ||
h2scf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_v2_module); | ||
- | ||
+#if (NGX_HTTP_LUA_KONG) | ||
+ if(ngx_http_lua_kong_ssl_get_http2_alpn_enabled(c->ssl, h2scf->enable || hc->addr_conf->http2)) { | ||
+#else | ||
if (h2scf->enable || hc->addr_conf->http2) { | ||
+#endif | ||
srv = (unsigned char *) NGX_HTTP_V2_ALPN_PROTO NGX_HTTP_ALPN_PROTOS; | ||
srvlen = sizeof(NGX_HTTP_V2_ALPN_PROTO NGX_HTTP_ALPN_PROTOS) - 1; | ||
|
||
diff --git a/bundle/ngx_lua-0.10.26/src/ngx_http_lua_ssl.h b/bundle/ngx_lua-0.10.26/src/ngx_http_lua_ssl.h | ||
index 3d577c6..aa20f03 100644 | ||
--- a/bundle/ngx_lua-0.10.26/src/ngx_http_lua_ssl.h | ||
+++ b/bundle/ngx_lua-0.10.26/src/ngx_http_lua_ssl.h | ||
@@ -38,6 +38,9 @@ typedef struct { | ||
unsigned entered_client_hello_handler:1; | ||
unsigned entered_cert_handler:1; | ||
unsigned entered_sess_fetch_handler:1; | ||
+#if (NGX_HTTP_LUA_KONG) | ||
+ unsigned disable_http2_alpn:1; | ||
+#endif | ||
} ngx_http_lua_ssl_ctx_t; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
message: | | ||
**Core**: Added `tls.disable_http2_alpn()` function needed patch for disabling HTTP/2 ALPN when tls handshake. | ||
type: feature | ||
scope: Core |
6d7bf68
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bazel Build
Docker image available
kong/kong:6d7bf6819fc4a253fe80b12b5a5f1f6ec8f342dc
Artifacts available https://github.com/Kong/kong/actions/runs/11435983339