Skip to content

Commit 9af0601

Browse files
jimf5pluknet
authored andcommitted
Tests: loading certificate bundles.
1 parent e5b70d2 commit 9af0601

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

ssl_verify_client.t

+17-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ select STDERR; $| = 1;
2525
select STDOUT; $| = 1;
2626

2727
my $t = Test::Nginx->new()->has(qw/http http_ssl sni socket_ssl_sni/)
28-
->has_daemon('openssl')->plan(13);
28+
->has_daemon('openssl')->plan(14);
2929

3030
$t->write_file_expand('nginx.conf', <<'EOF');
3131
@@ -108,6 +108,17 @@ http {
108108
109109
ssl_verify_client on;
110110
}
111+
112+
server {
113+
listen 127.0.0.1:8443 ssl;
114+
server_name dup;
115+
116+
ssl_certificate_key 1.example.com.key;
117+
ssl_certificate 1.example.com.crt;
118+
119+
ssl_verify_client optional;
120+
ssl_client_certificate dup.2.example.com.crt;
121+
}
111122
}
112123
113124
EOF
@@ -130,6 +141,8 @@ foreach my $name ('1.example.com', '2.example.com', '3.example.com') {
130141
or die "Can't create certificate for $name: $!\n";
131142
}
132143

144+
$t->write_file('dup.2.example.com.crt', $t->read_file('2.example.com.crt') x 2);
145+
133146
sleep 1 if $^O eq 'MSWin32';
134147

135148
$t->write_file('t', 'SEE-THIS');
@@ -159,6 +172,9 @@ local $TODO = 'broken TLSv1.3 CA list in LibreSSL'
159172
my $ca = join ' ', get('optional', '3.example.com');
160173
is($ca, '/CN=2.example.com', 'no trusted sent');
161174

175+
$ca = join ' ', get('dup');
176+
is($ca, '/CN=2.example.com', 'no duplicates sent');
177+
162178
}
163179

164180
like(get('optional', undef, 'localhost'), qr/421 Misdirected/, 'misdirected');

0 commit comments

Comments
 (0)