diff --git a/modules/ngx_http_xquic_module/ngx_http_xquic.c b/modules/ngx_http_xquic_module/ngx_http_xquic.c index 088e6c0ef4..33bbf8415f 100644 --- a/modules/ngx_http_xquic_module/ngx_http_xquic.c +++ b/modules/ngx_http_xquic_module/ngx_http_xquic.c @@ -191,22 +191,6 @@ ngx_http_v3_cert_cb(const char *sni, void **chain, hc = qc->http_connection; c = qc->connection; -#ifdef T_NGX_HTTP_HAVE_LUA_MODULE - ngx_http_lua_srv_conf_t *lscf = NULL; - - lscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_lua_module); - if (lscf != NULL && lscf->srv.ssl_cert_src.len) { - ngx_ssl_conn_t *ssl_conn = qc->ssl_conn; - - ngx_http_lua_ssl_cert_handler(ssl_conn, NULL); - *chain = NULL; - *cert = NULL; - *key = NULL; - - return XQC_OK; - } -#endif - /* The ngx_http_find_virtual_server() function requires ngx_http_connection_t in c->data */ c->data = hc; @@ -238,6 +222,22 @@ ngx_http_v3_cert_cb(const char *sni, void **chain, "|xquic|can't find virtual server, use default server|"); } +#ifdef T_NGX_HTTP_HAVE_LUA_MODULE + ngx_http_lua_srv_conf_t *lscf = NULL; + + lscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_lua_module); + if (lscf != NULL && lscf->srv.ssl_cert_src.len) { + ngx_ssl_conn_t *ssl_conn = qc->ssl_conn; + + ngx_http_lua_ssl_cert_handler(ssl_conn, NULL); + *chain = NULL; + *cert = NULL; + *key = NULL; + + return XQC_OK; + } +#endif + /* get http ssl config */ sscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_ssl_module); if (NULL == sscf || NULL == sscf->ssl.ctx) {