Skip to content

Commit

Permalink
match server block first in ngx_http_v3_cert_cb
Browse files Browse the repository at this point in the history
  • Loading branch information
lurker-Chen committed Sep 12, 2023
1 parent 0cbe1a0 commit 4a6f3ec
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions modules/ngx_http_xquic_module/ngx_http_xquic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 4a6f3ec

Please sign in to comment.