Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 7466:48c87377aabd
SSL: fixed possible segfault with dynamic certificates.
A virtual server may have no SSL context if it does not have certificates
defined, so we have to use config of the ngx_http_ssl_module from the
SSL context in the certificate callback. To do so, it is now passed as
the argument of the callback.
The stream module doesn't really need any changes, but was modified as
well to match http code.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 25 Feb 2019 21:16:26 +0300 |
parents | 180df83473a4 |
children | 7e8bcba6d039 |
comparison
equal
deleted
inserted
replaced
7465:6708bec13757 | 7466:48c87377aabd |
---|---|
971 return 0; | 971 return 0; |
972 } | 972 } |
973 | 973 |
974 r->logged = 1; | 974 r->logged = 1; |
975 | 975 |
976 sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module); | 976 sscf = arg; |
977 | 977 |
978 nelts = sscf->certificate_values->nelts; | 978 nelts = sscf->certificate_values->nelts; |
979 certs = sscf->certificate_values->elts; | 979 certs = sscf->certificate_values->elts; |
980 keys = sscf->certificate_key_values->elts; | 980 keys = sscf->certificate_key_values->elts; |
981 | 981 |