From e49d933ebccb5e86b749c94ddb378dafc28e435d Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Mon, 29 Jul 2013 13:23:16 +0400 Subject: [PATCH] Upstream: reliably detect connection failures with SSL peers. --- src/http/ngx_http_upstream.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index cd946340a..9e2830d07 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -1282,6 +1282,11 @@ ngx_http_upstream_ssl_init_connection(ngx_http_request_t *r, { 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)