From 7e55ad39e89428903dfe54e453da1bf0f7d27c67 Mon Sep 17 00:00:00 2001 From: willmafh Date: Mon, 22 Sep 2025 12:54:36 +0800 Subject: [PATCH] chore: delete unnecessary checking codes. --- src/ngx_http_lua_ssl_certby.c | 11 ----------- src/ngx_http_lua_ssl_client_helloby.c | 11 ----------- 2 files changed, 22 deletions(-) diff --git a/src/ngx_http_lua_ssl_certby.c b/src/ngx_http_lua_ssl_certby.c index 2abee0ef4b..b2bb87bff9 100644 --- a/src/ngx_http_lua_ssl_certby.c +++ b/src/ngx_http_lua_ssl_certby.c @@ -201,7 +201,6 @@ ngx_http_lua_ssl_cert_handler(ngx_ssl_conn_t *ssl_conn, void *data) ngx_http_lua_srv_conf_t *lscf; ngx_http_core_loc_conf_t *clcf; ngx_http_lua_ssl_ctx_t *cctx; - ngx_http_core_srv_conf_t *cscf; c = ngx_ssl_get_connection(ssl_conn); @@ -299,16 +298,6 @@ ngx_http_lua_ssl_cert_handler(ngx_ssl_conn_t *ssl_conn, void *data) c->log->action = "loading SSL certificate by lua"; - if (lscf->srv.ssl_cert_handler == NULL) { - cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); - - ngx_log_error(NGX_LOG_ALERT, c->log, 0, - "no ssl_certificate_by_lua* defined in " - "server %V", &cscf->server_name); - - goto failed; - } - rc = lscf->srv.ssl_cert_handler(r, lscf, L); if (rc >= NGX_OK || rc == NGX_ERROR) { diff --git a/src/ngx_http_lua_ssl_client_helloby.c b/src/ngx_http_lua_ssl_client_helloby.c index 81b7a01f51..d8ab83814e 100644 --- a/src/ngx_http_lua_ssl_client_helloby.c +++ b/src/ngx_http_lua_ssl_client_helloby.c @@ -191,7 +191,6 @@ ngx_http_lua_ssl_client_hello_handler(ngx_ssl_conn_t *ssl_conn, ngx_http_lua_srv_conf_t *lscf; ngx_http_core_loc_conf_t *clcf; ngx_http_lua_ssl_ctx_t *cctx; - ngx_http_core_srv_conf_t *cscf; c = ngx_ssl_get_connection(ssl_conn); @@ -290,16 +289,6 @@ ngx_http_lua_ssl_client_hello_handler(ngx_ssl_conn_t *ssl_conn, c->log->action = "loading SSL client hello by lua"; - if (lscf->srv.ssl_client_hello_handler == NULL) { - cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); - - ngx_log_error(NGX_LOG_ALERT, c->log, 0, - "no ssl_client_hello_by_lua* defined in " - "server %V", &cscf->server_name); - - goto failed; - } - rc = lscf->srv.ssl_client_hello_handler(r, lscf, L); if (rc >= NGX_OK || rc == NGX_ERROR) {