changeset 5305:12b750d35162

Upstream: reliably detect connection failures with SSL peers.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 29 Jul 2013 13:23:16 +0400
parents d3eab5e2df5f
children 43900b822890
files src/http/ngx_http_upstream.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1282,6 +1282,11 @@ ngx_http_upstream_ssl_init_connection(ng
 {
     ngx_int_t   rc;
 
+    if (ngx_http_upstream_test_connect(c) != NGX_OK) {
+        ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR);
+        return;
+    }
+
     if (ngx_ssl_create_connection(u->conf->ssl, c,
                                   NGX_SSL_BUFFER|NGX_SSL_CLIENT)
         != NGX_OK)