Latest update - 9121
This commit is contained in:
@@ -283,11 +283,11 @@ ngx_mail_init_session_handler(ngx_event_t *rev)
|
||||
|
||||
s = c->data;
|
||||
|
||||
sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module);
|
||||
|
||||
if (sslcf->enable || s->ssl) {
|
||||
if (s->ssl) {
|
||||
c->log->action = "SSL handshaking";
|
||||
|
||||
sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module);
|
||||
|
||||
ngx_mail_ssl_init_connection(&sslcf->ssl, c);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,6 @@ static int ngx_mail_ssl_alpn_select(ngx_ssl_conn_t *ssl_conn,
|
||||
static void *ngx_mail_ssl_create_conf(ngx_conf_t *cf);
|
||||
static char *ngx_mail_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child);
|
||||
|
||||
static char *ngx_mail_ssl_enable(ngx_conf_t *cf, ngx_command_t *cmd,
|
||||
void *conf);
|
||||
static char *ngx_mail_ssl_starttls(ngx_conf_t *cf, ngx_command_t *cmd,
|
||||
void *conf);
|
||||
static char *ngx_mail_ssl_password_file(ngx_conf_t *cf, ngx_command_t *cmd,
|
||||
@@ -66,24 +64,12 @@ static ngx_conf_enum_t ngx_mail_ssl_verify[] = {
|
||||
};
|
||||
|
||||
|
||||
static ngx_conf_deprecated_t ngx_mail_ssl_deprecated = {
|
||||
ngx_conf_deprecated, "ssl", "listen ... ssl"
|
||||
};
|
||||
|
||||
|
||||
static ngx_conf_post_t ngx_mail_ssl_conf_command_post =
|
||||
{ ngx_mail_ssl_conf_command_check };
|
||||
|
||||
|
||||
static ngx_command_t ngx_mail_ssl_commands[] = {
|
||||
|
||||
{ ngx_string("ssl"),
|
||||
NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_FLAG,
|
||||
ngx_mail_ssl_enable,
|
||||
NGX_MAIL_SRV_CONF_OFFSET,
|
||||
offsetof(ngx_mail_ssl_conf_t, enable),
|
||||
&ngx_mail_ssl_deprecated },
|
||||
|
||||
{ ngx_string("starttls"),
|
||||
NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
|
||||
ngx_mail_ssl_starttls,
|
||||
@@ -323,7 +309,6 @@ ngx_mail_ssl_create_conf(ngx_conf_t *cf)
|
||||
* scf->shm_zone = NULL;
|
||||
*/
|
||||
|
||||
scf->enable = NGX_CONF_UNSET;
|
||||
scf->starttls = NGX_CONF_UNSET_UINT;
|
||||
scf->certificates = NGX_CONF_UNSET_PTR;
|
||||
scf->certificate_keys = NGX_CONF_UNSET_PTR;
|
||||
@@ -350,7 +335,6 @@ ngx_mail_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child)
|
||||
char *mode;
|
||||
ngx_pool_cleanup_t *cln;
|
||||
|
||||
ngx_conf_merge_value(conf->enable, prev->enable, 0);
|
||||
ngx_conf_merge_uint_value(conf->starttls, prev->starttls,
|
||||
NGX_MAIL_STARTTLS_OFF);
|
||||
|
||||
@@ -393,9 +377,6 @@ ngx_mail_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child)
|
||||
if (conf->listen) {
|
||||
mode = "listen ... ssl";
|
||||
|
||||
} else if (conf->enable) {
|
||||
mode = "ssl";
|
||||
|
||||
} else if (conf->starttls != NGX_MAIL_STARTTLS_OFF) {
|
||||
mode = "starttls";
|
||||
|
||||
@@ -544,34 +525,6 @@ ngx_mail_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child)
|
||||
}
|
||||
|
||||
|
||||
static char *
|
||||
ngx_mail_ssl_enable(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
{
|
||||
ngx_mail_ssl_conf_t *scf = conf;
|
||||
|
||||
char *rv;
|
||||
|
||||
rv = ngx_conf_set_flag_slot(cf, cmd, conf);
|
||||
|
||||
if (rv != NGX_CONF_OK) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (scf->enable && (ngx_int_t) scf->starttls > NGX_MAIL_STARTTLS_OFF) {
|
||||
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
||||
"\"starttls\" directive conflicts with \"ssl on\"");
|
||||
return NGX_CONF_ERROR;
|
||||
}
|
||||
|
||||
if (!scf->listen) {
|
||||
scf->file = cf->conf_file->file.name.data;
|
||||
scf->line = cf->conf_file->line;
|
||||
}
|
||||
|
||||
return NGX_CONF_OK;
|
||||
}
|
||||
|
||||
|
||||
static char *
|
||||
ngx_mail_ssl_starttls(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
{
|
||||
@@ -585,12 +538,6 @@ ngx_mail_ssl_starttls(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (scf->enable == 1 && (ngx_int_t) scf->starttls > NGX_MAIL_STARTTLS_OFF) {
|
||||
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
||||
"\"ssl\" directive conflicts with \"starttls\"");
|
||||
return NGX_CONF_ERROR;
|
||||
}
|
||||
|
||||
if (!scf->listen) {
|
||||
scf->file = cf->conf_file->file.name.data;
|
||||
scf->line = cf->conf_file->line;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
|
||||
typedef struct {
|
||||
ngx_flag_t enable;
|
||||
ngx_flag_t prefer_server_ciphers;
|
||||
|
||||
ngx_ssl_t ssl;
|
||||
|
||||
Reference in New Issue
Block a user