Skip to content

Commit 31e4c9a

Browse files
committed
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.
1 parent 3d61a1f commit 31e4c9a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

stream_proxy_ssl_conf_command.t

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@ BEGIN { use FindBin; chdir($FindBin::Bin); }
1616

1717
use lib 'lib';
1818
use Test::Nginx;
19-
use Test::Nginx::Stream qw/ stream /;
2019

2120
###############################################################################
2221

2322
select STDERR; $| = 1;
2423
select STDOUT; $| = 1;
2524

26-
my $t = Test::Nginx->new()->has(qw/stream stream_ssl stream_return/)
25+
my $t = Test::Nginx->new()->has(qw/stream stream_ssl http http_ssl/)
2726
->has_daemon('openssl');
2827

2928
$t->{_configure_args} =~ /OpenSSL ([\d\.]+)/;
@@ -52,14 +51,20 @@ stream {
5251
proxy_ssl_conf_command Certificate override.crt;
5352
proxy_ssl_conf_command PrivateKey override.key;
5453
}
54+
}
55+
56+
http {
57+
%%TEST_GLOBALS_HTTP%%
5558
5659
server {
5760
listen 127.0.0.1:8081 ssl;
58-
return $ssl_client_s_dn;
61+
server_name localhost;
5962
6063
ssl_certificate localhost.crt;
6164
ssl_certificate_key localhost.key;
6265
ssl_verify_client optional_no_ca;
66+
67+
add_header X-Cert $ssl_client_s_dn always;
6368
}
6469
}
6570
@@ -88,7 +93,6 @@ $t->run()->plan(1);
8893

8994
###############################################################################
9095

91-
like(stream('127.0.0.1:' . port(8080))->read(), qr/CN=override/,
92-
'Certificate');
96+
like(http_get('/'), qr/CN=override/, 'proxy_ssl_conf_command');
9397

9498
###############################################################################

0 commit comments

Comments
 (0)