@@ -25,7 +25,7 @@ select STDERR; $| = 1;
25
25
select STDOUT ; $| = 1;
26
26
27
27
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 );
29
29
30
30
$t -> write_file_expand(' nginx.conf' , <<'EOF' );
31
31
@@ -108,6 +108,17 @@ http {
108
108
109
109
ssl_verify_client on;
110
110
}
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
+ }
111
122
}
112
123
113
124
EOF
@@ -130,6 +141,8 @@ foreach my $name ('1.example.com', '2.example.com', '3.example.com') {
130
141
or die " Can't create certificate for $name : $! \n " ;
131
142
}
132
143
144
+ $t -> write_file(' dup.2.example.com.crt' , $t -> read_file(' 2.example.com.crt' ) x 2 );
145
+
133
146
sleep 1 if $^O eq ' MSWin32' ;
134
147
135
148
$t -> write_file(' t' , ' SEE-THIS' );
@@ -159,6 +172,9 @@ local $TODO = 'broken TLSv1.3 CA list in LibreSSL'
159
172
my $ca = join ' ' , get(' optional' , ' 3.example.com' );
160
173
is($ca , ' /CN=2.example.com' , ' no trusted sent' );
161
174
175
+ $ca = join ' ' , get(' dup' );
176
+ is($ca , ' /CN=2.example.com' , ' no duplicates sent' );
177
+
162
178
}
163
179
164
180
like(get(' optional' , undef , ' localhost' ), qr / 421 Misdirected/ , ' misdirected' );
0 commit comments