summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2025-11-06 17:30:41 +0400
committerSergey Kandaurov <s.kandaurov@f5.com>2025-11-10 20:01:28 +0400
commit38a701d88b14f0747003c4e893d9fb13f51639ca (patch)
tree02b6dc521ddb85247bde8a4387402a22da2547c2 /src/http/modules
parentac99f2808b9ff7bdce91b129539cb1ed30dd1458 (diff)
downloadnginx-38a701d88b14f0747003c4e893d9fb13f51639ca.tar.gz
nginx-38a701d88b14f0747003c4e893d9fb13f51639ca.tar.bz2
SSL: ngx_ssl_set_client_hello_callback() error handling.
The function interface is changed to follow a common approach to other functions used to setup SSL_CTX, with an exception of "ngx_conf_t *cf" since it is not bound to nginx configuration. This is required to report and propagate SSL_CTX_set_ex_data() errors, as reminded by Coverity (CID 1668589).
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_ssl_module.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_ssl_module.c b/src/http/modules/ngx_http_ssl_module.c
index dc82472d3..c71a5de08 100644
--- a/src/http/modules/ngx_http_ssl_module.c
+++ b/src/http/modules/ngx_http_ssl_module.c
@@ -758,7 +758,9 @@ ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
{
static ngx_ssl_client_hello_arg cb = { ngx_http_ssl_servername };
- ngx_ssl_set_client_hello_callback(conf->ssl.ctx, &cb);
+ if (ngx_ssl_set_client_hello_callback(&conf->ssl, &cb) != NGX_OK) {
+ return NGX_CONF_ERROR;
+ }
if (SSL_CTX_set_tlsext_servername_callback(conf->ssl.ctx,
ngx_http_ssl_servername)