comparison src/imap/ngx_imap_ssl_module.c @ 132:91372f004adf NGINX_0_3_13

nginx 0.3.13 *) Feature: the IMAP/POP3 proxy supports STARTTLS and STLS. *) Bugfix: the IMAP/POP3 proxy did not work with the select, poll, and /dev/poll methods. *) Bugfix: in SSI handling. *) Bugfix: now Solaris sendfilev() is not used to transfer the client request body to FastCGI-server via the unix domain socket. *) Bugfix: the "auth_basic" directive did not disable the authorization; bug appeared in 0.3.11.
author Igor Sysoev <http://sysoev.ru>
date Mon, 05 Dec 2005 00:00:00 +0300
parents df17fbafec8f
children 29a6403156b0
comparison
equal deleted inserted replaced
131:add6b1e86d38 132:91372f004adf
23 void *conf); 23 void *conf);
24 24
25 static char ngx_imap_ssl_openssl097[] = "OpenSSL 0.9.7 and higher"; 25 static char ngx_imap_ssl_openssl097[] = "OpenSSL 0.9.7 and higher";
26 26
27 #endif 27 #endif
28
29
30 static ngx_conf_enum_t ngx_http_starttls_state[] = {
31 { ngx_string("off"), NGX_IMAP_STARTTLS_OFF },
32 { ngx_string("on"), NGX_IMAP_STARTTLS_ON },
33 { ngx_string("only"), NGX_IMAP_STARTTLS_ONLY },
34 { ngx_null_string, 0 }
35 };
36
28 37
29 38
30 static ngx_conf_bitmask_t ngx_imap_ssl_protocols[] = { 39 static ngx_conf_bitmask_t ngx_imap_ssl_protocols[] = {
31 { ngx_string("SSLv2"), NGX_SSL_SSLv2 }, 40 { ngx_string("SSLv2"), NGX_SSL_SSLv2 },
32 { ngx_string("SSLv3"), NGX_SSL_SSLv3 }, 41 { ngx_string("SSLv3"), NGX_SSL_SSLv3 },
41 NGX_IMAP_MAIN_CONF|NGX_IMAP_SRV_CONF|NGX_CONF_FLAG, 50 NGX_IMAP_MAIN_CONF|NGX_IMAP_SRV_CONF|NGX_CONF_FLAG,
42 ngx_conf_set_flag_slot, 51 ngx_conf_set_flag_slot,
43 NGX_IMAP_SRV_CONF_OFFSET, 52 NGX_IMAP_SRV_CONF_OFFSET,
44 offsetof(ngx_imap_ssl_conf_t, enable), 53 offsetof(ngx_imap_ssl_conf_t, enable),
45 NULL }, 54 NULL },
55
56 { ngx_string("starttls"),
57 NGX_IMAP_MAIN_CONF|NGX_IMAP_SRV_CONF|NGX_CONF_TAKE1,
58 ngx_conf_set_enum_slot,
59 NGX_IMAP_SRV_CONF_OFFSET,
60 offsetof(ngx_imap_ssl_conf_t, starttls),
61 ngx_http_starttls_state },
46 62
47 { ngx_string("ssl_certificate"), 63 { ngx_string("ssl_certificate"),
48 NGX_IMAP_MAIN_CONF|NGX_IMAP_SRV_CONF|NGX_CONF_TAKE1, 64 NGX_IMAP_MAIN_CONF|NGX_IMAP_SRV_CONF|NGX_CONF_TAKE1,
49 ngx_conf_set_str_slot, 65 ngx_conf_set_str_slot,
50 NGX_IMAP_SRV_CONF_OFFSET, 66 NGX_IMAP_SRV_CONF_OFFSET,
144 * scf->ciphers.len = 0; 160 * scf->ciphers.len = 0;
145 * scf->ciphers.data = NULL; 161 * scf->ciphers.data = NULL;
146 */ 162 */
147 163
148 scf->enable = NGX_CONF_UNSET; 164 scf->enable = NGX_CONF_UNSET;
165 scf->starttls = NGX_CONF_UNSET;
149 scf->session_timeout = NGX_CONF_UNSET; 166 scf->session_timeout = NGX_CONF_UNSET;
150 scf->prefer_server_ciphers = NGX_CONF_UNSET; 167 scf->prefer_server_ciphers = NGX_CONF_UNSET;
151 168
152 return scf; 169 return scf;
153 } 170 }
160 ngx_imap_ssl_conf_t *conf = child; 177 ngx_imap_ssl_conf_t *conf = child;
161 178
162 ngx_pool_cleanup_t *cln; 179 ngx_pool_cleanup_t *cln;
163 180
164 ngx_conf_merge_value(conf->enable, prev->enable, 0); 181 ngx_conf_merge_value(conf->enable, prev->enable, 0);
165 182 ngx_conf_merge_value(conf->starttls, prev->starttls, NGX_IMAP_STARTTLS_OFF);
166 if (conf->enable == 0) { 183
184 if (conf->enable == 0 && conf->starttls == NGX_IMAP_STARTTLS_OFF) {
167 return NGX_CONF_OK; 185 return NGX_CONF_OK;
168 } 186 }
169 187
170 ngx_conf_merge_value(conf->session_timeout, 188 ngx_conf_merge_value(conf->session_timeout,
171 prev->session_timeout, 300); 189 prev->session_timeout, 300);