comparison stream_ssl_verify_client.t @ 1251:766bcbb632ee

Tests: removed TODO and try_run() checks for legacy versions.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 24 Nov 2017 19:58:40 +0300
parents 3fc6817cd84a
children dbce8fb5f5f8
comparison
equal deleted inserted replaced
1250:b708848eb49a 1251:766bcbb632ee
106 . "-out $d/$name.crt -keyout $d/$name.key " 106 . "-out $d/$name.crt -keyout $d/$name.key "
107 . ">>$d/openssl.out 2>&1") == 0 107 . ">>$d/openssl.out 2>&1") == 0
108 or die "Can't create certificate for $name: $!\n"; 108 or die "Can't create certificate for $name: $!\n";
109 } 109 }
110 110
111 $t->try_run('no ssl_verify_client')->plan(10); 111 $t->run()->plan(10);
112 112
113 ############################################################################### 113 ###############################################################################
114 114
115 TODO: {
116 todo_skip 'leaves coredump', 1 unless $t->has_version('1.11.9');
117
118 is(stream('127.0.0.1:' . port(8080))->read(), ':', 'plain connection'); 115 is(stream('127.0.0.1:' . port(8080))->read(), ':', 'plain connection');
119
120 }
121
122 TODO: {
123 local $TODO = 'fails on one-pass ngx_ssl_handshake'
124 unless $t->has_version('1.11.9');
125 116
126 is(get(8081), '', 'no cert'); 117 is(get(8081), '', 'no cert');
127 is(get(8082, '1.example.com'), '', 'bad optional cert'); 118 is(get(8082, '1.example.com'), '', 'bad optional cert');
128
129 }
130
131 is(get(8082), 'NONE:', 'no optional cert'); 119 is(get(8082), 'NONE:', 'no optional cert');
132 like(get(8083, '1.example.com'), qr/FAILED.*BEGIN/, 'bad optional_no_ca cert'); 120 like(get(8083, '1.example.com'), qr/FAILED.*BEGIN/, 'bad optional_no_ca cert');
133 121
134 like(get(8081, '2.example.com'), qr/SUCCESS.*BEGIN/, 'good cert'); 122 like(get(8081, '2.example.com'), qr/SUCCESS.*BEGIN/, 'good cert');
135 like(get(8082, '2.example.com'), qr/SUCCESS.*BEGIN/, 'good cert optional'); 123 like(get(8082, '2.example.com'), qr/SUCCESS.*BEGIN/, 'good cert optional');
141 my $ca = join ' ', get(8082, '3.example.com'); 129 my $ca = join ' ', get(8082, '3.example.com');
142 is($ca, '/CN=2.example.com', 'no trusted sent'); 130 is($ca, '/CN=2.example.com', 'no trusted sent');
143 131
144 } 132 }
145 133
146 TODO: {
147 local $TODO = 'not yet, see above' unless $t->has_version('1.11.9');
148
149 $t->stop(); 134 $t->stop();
150 135
151 is($t->read_file('status.log'), "500\n200\n", 'log'); 136 is($t->read_file('status.log'), "500\n200\n", 'log');
152
153 }
154 137
155 ############################################################################### 138 ###############################################################################
156 139
157 sub get { 140 sub get {
158 my ($port, $cert) = @_; 141 my ($port, $cert) = @_;