]> git.kaiwu.me - nginx.git/commitdiff
SSL: stop loading configs with invalid "ssl_ciphers" values.
authorPiotr Sikora <piotr@cloudflare.com>
Mon, 23 Sep 2013 05:36:11 +0000 (22:36 -0700)
committerPiotr Sikora <piotr@cloudflare.com>
Mon, 23 Sep 2013 05:36:11 +0000 (22:36 -0700)
While there, remove unnecessary check in ngx_mail_ssl_module.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
src/http/modules/ngx_http_ssl_module.c
src/mail/ngx_mail_ssl_module.c

index a6c803da0dcf64b23e269a010170bc4858c76dea..75dd7f4b041a2336a4ca90a967f8c371d0c0e3a7 100644 (file)
@@ -561,6 +561,7 @@ ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
         ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0,
                       "SSL_CTX_set_cipher_list(\"%V\") failed",
                       &conf->ciphers);
+        return NGX_CONF_ERROR;
     }
 
     if (conf->verify) {
index dbfb9c702ac7cec2c7a1ed459d57e98ab8d5218e..66aa18c3bbd0e9bce5a64501d93b158cc193d103 100644 (file)
@@ -287,15 +287,14 @@ ngx_mail_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child)
         return NGX_CONF_ERROR;
     }
 
-    if (conf->ciphers.len) {
-        if (SSL_CTX_set_cipher_list(conf->ssl.ctx,
-                                   (const char *) conf->ciphers.data)
-            == 0)
-        {
-            ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0,
-                          "SSL_CTX_set_cipher_list(\"%V\") failed",
-                          &conf->ciphers);
-        }
+    if (SSL_CTX_set_cipher_list(conf->ssl.ctx,
+                                (const char *) conf->ciphers.data)
+        == 0)
+    {
+        ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0,
+                      "SSL_CTX_set_cipher_list(\"%V\") failed",
+                      &conf->ciphers);
+        return NGX_CONF_ERROR;
     }
 
     if (conf->prefer_server_ciphers) {