11diff --git src/http/ngx_http_upstream.c src/http/ngx_http_upstream.c
2- index 76045c4..cee3e2a 100644
2+ index 04d813a..c812242 100644
33--- src/http/ngx_http_upstream.c
44+++ src/http/ngx_http_upstream.c
55@@ -8,6 +8,9 @@
@@ -10,9 +10,22 @@ index 76045c4..cee3e2a 100644
1010+ #include <ngx_http_apisix_module.h>
1111+ #endif
1212
13- #if (T_NGX_MULTI_UPSTREAM)
14- #include <ngx_http_multi_upstream_module.h>
15- @@ -1766,6 +1769,10 @@ ngx_http_upstream_ssl_init_connection(ngx_http_request_t *r,
13+
14+ #if (NGX_HTTP_CACHE)
15+ @@ -1697,8 +1700,11 @@ ngx_http_upstream_ssl_init_connection(ngx_http_request_t *r,
16+ NGX_HTTP_INTERNAL_SERVER_ERROR);
17+ return;
18+ }
19+ -
20+ + #if (NGX_HTTP_APISIX)
21+ + if (u->conf->ssl_server_name || ngx_http_apisix_get_upstream_ssl_verify(r, u->conf->ssl_verify)) {
22+ + #else
23+ if (u->conf->ssl_server_name || u->conf->ssl_verify) {
24+ + #endif
25+ if (ngx_http_upstream_ssl_name(r, u, c) != NGX_OK) {
26+ ngx_http_upstream_finalize_request(r, u,
27+ NGX_HTTP_INTERNAL_SERVER_ERROR);
28+ @@ -1738,6 +1744,10 @@ ngx_http_upstream_ssl_init_connection(ngx_http_request_t *r,
1629
1730 r->connection->log->action = "SSL handshaking to upstream";
1831
@@ -23,3 +36,15 @@ index 76045c4..cee3e2a 100644
2336 rc = ngx_ssl_handshake(c);
2437
2538 if (rc == NGX_AGAIN) {
39+ @@ -1785,7 +1795,11 @@ ngx_http_upstream_ssl_handshake(ngx_http_request_t *r, ngx_http_upstream_t *u,
40+
41+ if (c->ssl->handshaked) {
42+
43+ + #if (NGX_HTTP_APISIX)
44+ + if (ngx_http_apisix_get_upstream_ssl_verify(r, u->conf->ssl_verify)) {
45+ + #else
46+ if (u->conf->ssl_verify) {
47+ + #endif
48+ rc = SSL_get_verify_result(c->ssl->connection);
49+
50+ if (rc != X509_V_OK) {
0 commit comments