Mercurial > hg > nginx-vendor-current
diff 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 |
line wrap: on
line diff
--- a/src/imap/ngx_imap_ssl_module.c +++ b/src/imap/ngx_imap_ssl_module.c @@ -27,6 +27,15 @@ static char ngx_imap_ssl_openssl097[] = #endif +static ngx_conf_enum_t ngx_http_starttls_state[] = { + { ngx_string("off"), NGX_IMAP_STARTTLS_OFF }, + { ngx_string("on"), NGX_IMAP_STARTTLS_ON }, + { ngx_string("only"), NGX_IMAP_STARTTLS_ONLY }, + { ngx_null_string, 0 } +}; + + + static ngx_conf_bitmask_t ngx_imap_ssl_protocols[] = { { ngx_string("SSLv2"), NGX_SSL_SSLv2 }, { ngx_string("SSLv3"), NGX_SSL_SSLv3 }, @@ -44,6 +53,13 @@ static ngx_command_t ngx_imap_ssl_comma offsetof(ngx_imap_ssl_conf_t, enable), NULL }, + { ngx_string("starttls"), + NGX_IMAP_MAIN_CONF|NGX_IMAP_SRV_CONF|NGX_CONF_TAKE1, + ngx_conf_set_enum_slot, + NGX_IMAP_SRV_CONF_OFFSET, + offsetof(ngx_imap_ssl_conf_t, starttls), + ngx_http_starttls_state }, + { ngx_string("ssl_certificate"), NGX_IMAP_MAIN_CONF|NGX_IMAP_SRV_CONF|NGX_CONF_TAKE1, ngx_conf_set_str_slot, @@ -146,6 +162,7 @@ ngx_imap_ssl_create_conf(ngx_conf_t *cf) */ scf->enable = NGX_CONF_UNSET; + scf->starttls = NGX_CONF_UNSET; scf->session_timeout = NGX_CONF_UNSET; scf->prefer_server_ciphers = NGX_CONF_UNSET; @@ -162,8 +179,9 @@ ngx_imap_ssl_merge_conf(ngx_conf_t *cf, ngx_pool_cleanup_t *cln; ngx_conf_merge_value(conf->enable, prev->enable, 0); + ngx_conf_merge_value(conf->starttls, prev->starttls, NGX_IMAP_STARTTLS_OFF); - if (conf->enable == 0) { + if (conf->enable == 0 && conf->starttls == NGX_IMAP_STARTTLS_OFF) { return NGX_CONF_OK; }