Mercurial > hg > nginx-tests
changeset 1759:8f13779e2cde
Tests: fixed stream_proxy_ssl_conf_command.t on win32.
The backend is adjusted to always emit "subject DN" of the client certificate,
same as in proxy_ssl_conf_command.t. This eliminates occasional test failures
seen due to SSL verification errors for the reason outlined in eadd24ccfda1,
while avoiding to insert an extra startup delay.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 24 May 2022 15:28:21 +0400 |
parents | 7c727869aeda |
children | 3580ad4b575f |
files | stream_proxy_ssl_conf_command.t |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/stream_proxy_ssl_conf_command.t Wed May 11 09:23:40 2022 -0700 +++ b/stream_proxy_ssl_conf_command.t Tue May 24 15:28:21 2022 +0400 @@ -16,14 +16,13 @@ use lib 'lib'; use Test::Nginx; -use Test::Nginx::Stream qw/ stream /; ############################################################################### select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/stream stream_ssl stream_return/) +my $t = Test::Nginx->new()->has(qw/stream stream_ssl http http_ssl/) ->has_daemon('openssl'); $t->{_configure_args} =~ /OpenSSL ([\d\.]+)/; @@ -52,14 +51,20 @@ proxy_ssl_conf_command Certificate override.crt; proxy_ssl_conf_command PrivateKey override.key; } +} + +http { + %%TEST_GLOBALS_HTTP%% server { listen 127.0.0.1:8081 ssl; - return $ssl_client_s_dn; + server_name localhost; ssl_certificate localhost.crt; ssl_certificate_key localhost.key; ssl_verify_client optional_no_ca; + + add_header X-Cert $ssl_client_s_dn always; } } @@ -88,7 +93,6 @@ ############################################################################### -like(stream('127.0.0.1:' . port(8080))->read(), qr/CN=override/, - 'Certificate'); +like(http_get('/'), qr/CN=override/, 'proxy_ssl_conf_command'); ###############################################################################