# HG changeset patch # User Maxim Dounin <mdou...@mdounin.ru> # Date 1744510422 -10800 # Sun Apr 13 05:13:42 2025 +0300 # Node ID 0a913a10945b996bcdac073467bf7bc957ef716e # Parent a23ab99972ae28e2bd2ce9badfaa2e52c6a03e24 Tests: tests for proxy_ssl_password_file issue.
diff --git a/proxy_ssl_certificate_vars.t b/proxy_ssl_certificate_vars.t --- a/proxy_ssl_certificate_vars.t +++ b/proxy_ssl_certificate_vars.t @@ -61,6 +61,20 @@ http { proxy_ssl_certificate $arg_cert; proxy_ssl_certificate_key $arg_cert; } + + location /complex/ { + proxy_ssl_certificate $arg_cert.example.com.crt; + proxy_ssl_certificate_key $arg_cert.example.com.key; + proxy_ssl_password_file password; + + location /complex/1 { + proxy_pass https://127.0.0.1:8082/; + } + + location /complex/2 { + proxy_pass https://127.0.0.1:8082/; + } + } } server { @@ -133,7 +147,7 @@ sleep 1 if $^O eq 'MSWin32'; $t->write_file('password', '3.example.com'); $t->write_file('index.html', ''); -$t->run()->plan(4); +$t->run()->plan(6); ############################################################################### @@ -146,4 +160,15 @@ like(http_get('/encrypted?cert=3'), like(http_get('/none'), qr/X-Verify: NONE/ms, 'variable - no certificate'); +like(http_get('/complex/1?cert=3'), + qr/X-Verify: SUCCESS/ms, 'variable - inherited encrypted key 1st'); + +SKIP: { +skip 'leaves coredump', 1 unless $t->has_version('1.27.6') + or $ENV{TEST_NGINX_UNSAFE}; + +like(http_get('/complex/2?cert=3'), + qr/X-Verify: SUCCESS/ms, 'variable - inherited encrypted key 2nd'); +} + ###############################################################################