aboutsummaryrefslogtreecommitdiff
path: root/src/imap/ngx_imap_ssl_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-12-05 13:18:09 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-12-05 13:18:09 +0000
commitd3283ff9224a41a1a24c2d89f671811c0747480a (patch)
treee122c436f72f587622e8ec0e75632434045e330d /src/imap/ngx_imap_ssl_module.c
parent0624ed3d7eaa1995d9e5ec4292bd1eccda09cafc (diff)
downloadnginx-release-0.3.13.tar.gz
nginx-release-0.3.13.zip
nginx-0.3.13-RELEASE importrelease-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; the bug had appeared in 0.3.11.
Diffstat (limited to 'src/imap/ngx_imap_ssl_module.c')
-rw-r--r--src/imap/ngx_imap_ssl_module.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/imap/ngx_imap_ssl_module.c b/src/imap/ngx_imap_ssl_module.c
index cbbbb6802..cb2b8caf5 100644
--- 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[] = "OpenSSL 0.9.7 and higher";
#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_commands[] = {
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, void *parent, void *child)
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;
}