You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openresty/patches/nginx/1.29.4/nginx-1.29.4-quic_ssl_lua_y...

66 lines
2.3 KiB
Diff

diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h
index 707ab216b..bd787c74e 100644
--- a/src/core/ngx_config.h
+++ b/src/core/ngx_config.h
@@ -18,6 +18,8 @@
#endif
+#define HAVE_QUIC_SSL_LUA_YIELD_PATCH 1
+
#if (NGX_FREEBSD)
#include <ngx_freebsd_config.h>
diff --git a/src/event/quic/ngx_event_quic.c b/src/event/quic/ngx_event_quic.c
index 6a59aaf93..08605ff24 100644
--- a/src/event/quic/ngx_event_quic.c
+++ b/src/event/quic/ngx_event_quic.c
@@ -14,7 +14,6 @@ static ngx_quic_connection_t *ngx_quic_new_connection(ngx_connection_t *c,
ngx_quic_conf_t *conf, ngx_quic_header_t *pkt);
static ngx_int_t ngx_quic_handle_stateless_reset(ngx_connection_t *c,
ngx_quic_header_t *pkt);
-static void ngx_quic_input_handler(ngx_event_t *rev);
static void ngx_quic_close_handler(ngx_event_t *ev);
static ngx_int_t ngx_quic_handle_datagram(ngx_connection_t *c, ngx_buf_t *b,
@@ -400,7 +399,7 @@ ngx_quic_handle_stateless_reset(ngx_connection_t *c, ngx_quic_header_t *pkt)
}
-static void
+void
ngx_quic_input_handler(ngx_event_t *rev)
{
ngx_int_t rc;
diff --git a/src/event/quic/ngx_event_quic.h b/src/event/quic/ngx_event_quic.h
index 4f899ec0a..649c0efcf 100644
--- a/src/event/quic/ngx_event_quic.h
+++ b/src/event/quic/ngx_event_quic.h
@@ -141,5 +141,6 @@ ngx_int_t ngx_quic_get_packet_dcid(ngx_log_t *log, u_char *data, size_t len,
ngx_str_t *dcid);
ngx_int_t ngx_quic_derive_key(ngx_log_t *log, const char *label,
ngx_str_t *secret, ngx_str_t *salt, u_char *out, size_t len);
+void ngx_quic_input_handler(ngx_event_t *rev);
#endif /* _NGX_EVENT_QUIC_H_INCLUDED_ */
diff --git a/src/event/quic/ngx_event_quic_ssl.c b/src/event/quic/ngx_event_quic_ssl.c
index a502431f4..adc22b645 100644
--- a/src/event/quic/ngx_event_quic_ssl.c
+++ b/src/event/quic/ngx_event_quic_ssl.c
@@ -713,7 +713,14 @@ ngx_quic_handshake(ngx_connection_t *c)
return NGX_ERROR;
}
- if (sslerr != SSL_ERROR_WANT_READ) {
+ if (sslerr != SSL_ERROR_WANT_READ
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L
+ && sslerr != SSL_ERROR_WANT_X509_LOOKUP
+#endif
+#ifdef SSL_ERROR_WANT_CLIENT_HELLO_CB
+ && sslerr != SSL_ERROR_WANT_CLIENT_HELLO_CB
+#endif
+ ) {
ngx_ssl_connection_error(c, sslerr, 0, "SSL_do_handshake() failed");
return NGX_ERROR;
}