diff options
author | Igor Sysoev <igor@sysoev.ru> | 2011-07-20 15:42:40 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2011-07-20 15:42:40 +0000 |
commit | f39642a90798af3c61de6e74b8da6cad96a9f159 (patch) | |
tree | f6cdf4512134bd66bfffa26cc30537a656316e3a /src/mail/ngx_mail_ssl_module.c | |
parent | e61ba26744d404a83eba0bf560b6697c453e6705 (diff) | |
download | nginx-f39642a90798af3c61de6e74b8da6cad96a9f159.tar.gz nginx-f39642a90798af3c61de6e74b8da6cad96a9f159.zip |
ECDHE support
patch by Adrian Kotelba
Diffstat (limited to 'src/mail/ngx_mail_ssl_module.c')
-rw-r--r-- | src/mail/ngx_mail_ssl_module.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mail/ngx_mail_ssl_module.c b/src/mail/ngx_mail_ssl_module.c index da91d37ce..5767a2fd4 100644 --- a/src/mail/ngx_mail_ssl_module.c +++ b/src/mail/ngx_mail_ssl_module.c @@ -9,7 +9,8 @@ #include <ngx_mail.h> -#define NGX_DEFAULT_CIPHERS "HIGH:!aNULL:!MD5" +#define NGX_DEFAULT_CIPHERS "HIGH:!aNULL:!MD5" +#define NGX_DEFAULT_ECDH_CURVE "prime256v1" static void *ngx_mail_ssl_create_conf(ngx_conf_t *cf); @@ -77,6 +78,13 @@ static ngx_command_t ngx_mail_ssl_commands[] = { offsetof(ngx_mail_ssl_conf_t, dhparam), NULL }, + { ngx_string("ssl_ecdh_curve"), + NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1, + ngx_conf_set_str_slot, + NGX_MAIL_SRV_CONF_OFFSET, + offsetof(ngx_mail_ssl_conf_t, ecdh_curve), + NULL }, + { ngx_string("ssl_protocols"), NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_1MORE, ngx_conf_set_bitmask_slot, @@ -163,6 +171,7 @@ ngx_mail_ssl_create_conf(ngx_conf_t *cf) * scf->certificate = { 0, NULL }; * scf->certificate_key = { 0, NULL }; * scf->dhparam = { 0, NULL }; + * scf->ecdh_curve = { 0, NULL }; * scf->ciphers = { 0, NULL }; * scf->shm_zone = NULL; */ @@ -204,6 +213,9 @@ ngx_mail_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child) ngx_conf_merge_str_value(conf->dhparam, prev->dhparam, ""); + ngx_conf_merge_str_value(conf->ecdh_curve, prev->ecdh_curve, + NGX_DEFAULT_ECDH_CURVE); + ngx_conf_merge_str_value(conf->ciphers, prev->ciphers, NGX_DEFAULT_CIPHERS); |