Skip to content

Commit c1965ad

Browse files
12711: update upstream mtls patch
1 parent eb00232 commit c1965ad

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

patch/1.27.1.1/nginx-upstream_mtls.patch

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git src/http/ngx_http_upstream.c src/http/ngx_http_upstream.c
2-
index 2be233c..78474f3 100644
2+
index 2be233c..06bbbb9 100644
33
--- src/http/ngx_http_upstream.c
44
+++ src/http/ngx_http_upstream.c
55
@@ -8,6 +8,9 @@
@@ -12,7 +12,20 @@ index 2be233c..78474f3 100644
1212

1313

1414
#if (NGX_HTTP_CACHE)
15-
@@ -1756,6 +1759,10 @@ ngx_http_upstream_ssl_init_connection(ngx_http_request_t *r,
15+
@@ -1713,8 +1716,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+
@@ -1756,6 +1762,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 2be233c..78474f3 100644
2336
rc = ngx_ssl_handshake(c);
2437

2538
if (rc == NGX_AGAIN) {
39+
@@ -1803,7 +1813,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

Comments
 (0)