Mercurial > hg > nginx
comparison src/mail/ngx_mail_ssl_module.c @ 2044:f45cec1cd270
DH parameters, ssl_dhparam
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 16 Jun 2008 05:51:32 +0000 |
parents | 12b3ad3353f9 |
children | e0b424b98f24 |
comparison
equal
deleted
inserted
replaced
2043:1d86674d1286 | 2044:f45cec1cd270 |
---|---|
72 { ngx_string("ssl_certificate_key"), | 72 { ngx_string("ssl_certificate_key"), |
73 NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1, | 73 NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1, |
74 ngx_conf_set_str_slot, | 74 ngx_conf_set_str_slot, |
75 NGX_MAIL_SRV_CONF_OFFSET, | 75 NGX_MAIL_SRV_CONF_OFFSET, |
76 offsetof(ngx_mail_ssl_conf_t, certificate_key), | 76 offsetof(ngx_mail_ssl_conf_t, certificate_key), |
77 NULL }, | |
78 | |
79 { ngx_string("ssl_dhparam"), | |
80 NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1, | |
81 ngx_conf_set_str_slot, | |
82 NGX_MAIL_SRV_CONF_OFFSET, | |
83 offsetof(ngx_mail_ssl_conf_t, dhparam), | |
77 NULL }, | 84 NULL }, |
78 | 85 |
79 { ngx_string("ssl_protocols"), | 86 { ngx_string("ssl_protocols"), |
80 NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_1MORE, | 87 NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_1MORE, |
81 ngx_conf_set_bitmask_slot, | 88 ngx_conf_set_bitmask_slot, |
161 | 168 |
162 /* | 169 /* |
163 * set by ngx_pcalloc(): | 170 * set by ngx_pcalloc(): |
164 * | 171 * |
165 * scf->protocols = 0; | 172 * scf->protocols = 0; |
166 * scf->certificate.len = 0; | 173 * scf->certificate = { 0, NULL }; |
167 * scf->certificate.data = NULL; | 174 * scf->certificate_key = { 0, NULL }; |
168 * scf->certificate_key.len = 0; | 175 * scf->dhparam = { 0, NULL }; |
169 * scf->certificate_key.data = NULL; | |
170 * scf->ciphers.len = 0; | 176 * scf->ciphers.len = 0; |
171 * scf->ciphers.data = NULL; | 177 * scf->ciphers.data = NULL; |
172 * scf->shm_zone = NULL; | 178 * scf->shm_zone = NULL; |
173 */ | 179 */ |
174 | 180 |
210 ngx_conf_merge_str_value(conf->certificate, prev->certificate, | 216 ngx_conf_merge_str_value(conf->certificate, prev->certificate, |
211 NGX_DEFLAUT_CERTIFICATE); | 217 NGX_DEFLAUT_CERTIFICATE); |
212 | 218 |
213 ngx_conf_merge_str_value(conf->certificate_key, prev->certificate_key, | 219 ngx_conf_merge_str_value(conf->certificate_key, prev->certificate_key, |
214 NGX_DEFLAUT_CERTIFICATE_KEY); | 220 NGX_DEFLAUT_CERTIFICATE_KEY); |
221 | |
222 ngx_conf_merge_str_value(conf->dhparam, prev->dhparam, ""); | |
215 | 223 |
216 ngx_conf_merge_str_value(conf->ciphers, prev->ciphers, NGX_DEFLAUT_CIPHERS); | 224 ngx_conf_merge_str_value(conf->ciphers, prev->ciphers, NGX_DEFLAUT_CIPHERS); |
217 | 225 |
218 | 226 |
219 conf->ssl.log = cf->log; | 227 conf->ssl.log = cf->log; |
258 | 266 |
259 if (ngx_ssl_generate_rsa512_key(&conf->ssl) != NGX_OK) { | 267 if (ngx_ssl_generate_rsa512_key(&conf->ssl) != NGX_OK) { |
260 return NGX_CONF_ERROR; | 268 return NGX_CONF_ERROR; |
261 } | 269 } |
262 | 270 |
271 if (ngx_ssl_dhparam(cf, &conf->ssl, &conf->dhparam) != NGX_OK) { | |
272 return NGX_CONF_ERROR; | |
273 } | |
274 | |
263 ngx_conf_merge_value(conf->builtin_session_cache, | 275 ngx_conf_merge_value(conf->builtin_session_cache, |
264 prev->builtin_session_cache, NGX_SSL_NONE_SCACHE); | 276 prev->builtin_session_cache, NGX_SSL_NONE_SCACHE); |
265 | 277 |
266 if (conf->shm_zone == NULL) { | 278 if (conf->shm_zone == NULL) { |
267 conf->shm_zone = prev->shm_zone; | 279 conf->shm_zone = prev->shm_zone; |