comparison src/mail/ngx_mail_ssl_module.c @ 4400:a0505851e70c

Added support for TLSv1.1, TLSv1.2 in ssl_protocols directive. Support for TLSv1.1 and TLSv1.2 protocols was introduced in OpenSSL 1.0.1 (-beta1 was recently released). This change makes it possible to disable these protocols and/or enable them without other protocols.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 11 Jan 2012 11:15:00 +0000
parents 7de74ed694c8
children d620f497c50f
comparison
equal deleted inserted replaced
4399:d2b3130fd8d9 4400:a0505851e70c
35 35
36 static ngx_conf_bitmask_t ngx_mail_ssl_protocols[] = { 36 static ngx_conf_bitmask_t ngx_mail_ssl_protocols[] = {
37 { ngx_string("SSLv2"), NGX_SSL_SSLv2 }, 37 { ngx_string("SSLv2"), NGX_SSL_SSLv2 },
38 { ngx_string("SSLv3"), NGX_SSL_SSLv3 }, 38 { ngx_string("SSLv3"), NGX_SSL_SSLv3 },
39 { ngx_string("TLSv1"), NGX_SSL_TLSv1 }, 39 { ngx_string("TLSv1"), NGX_SSL_TLSv1 },
40 { ngx_string("TLSv1.1"), NGX_SSL_TLSv1_1 },
41 { ngx_string("TLSv1.2"), NGX_SSL_TLSv1_2 },
40 { ngx_null_string, 0 } 42 { ngx_null_string, 0 }
41 }; 43 };
42 44
43 45
44 static ngx_command_t ngx_mail_ssl_commands[] = { 46 static ngx_command_t ngx_mail_ssl_commands[] = {
204 206
205 ngx_conf_merge_value(conf->prefer_server_ciphers, 207 ngx_conf_merge_value(conf->prefer_server_ciphers,
206 prev->prefer_server_ciphers, 0); 208 prev->prefer_server_ciphers, 0);
207 209
208 ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols, 210 ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
209 (NGX_CONF_BITMASK_SET|NGX_SSL_SSLv3|NGX_SSL_TLSv1)); 211 (NGX_CONF_BITMASK_SET|NGX_SSL_SSLv3|NGX_SSL_TLSv1
212 |NGX_SSL_TLSv1_1|NGX_SSL_TLSv1_2));
210 213
211 ngx_conf_merge_str_value(conf->certificate, prev->certificate, ""); 214 ngx_conf_merge_str_value(conf->certificate, prev->certificate, "");
212 ngx_conf_merge_str_value(conf->certificate_key, prev->certificate_key, ""); 215 ngx_conf_merge_str_value(conf->certificate_key, prev->certificate_key, "");
213 216
214 ngx_conf_merge_str_value(conf->dhparam, prev->dhparam, ""); 217 ngx_conf_merge_str_value(conf->dhparam, prev->dhparam, "");