Mercurial > hg > nginx-tests
comparison ssl.t @ 1220:0af58b78df35
Tests: removed single quotes from system() calls.
Single quotes were used to escape paths with spaces but are neither supported
in the Windows CMD shell, nor sufficient without proper %%TESTDIR%% expansion.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 20 Sep 2017 14:46:51 +0300 |
parents | e7e968e3eb74 |
children | 766bcbb632ee |
comparison
equal
deleted
inserted
replaced
1219:f373a718f646 | 1220:0af58b78df35 |
---|---|
159 | 159 |
160 $t->write_file('certserial', '1000'); | 160 $t->write_file('certserial', '1000'); |
161 $t->write_file('certindex', ''); | 161 $t->write_file('certindex', ''); |
162 | 162 |
163 system('openssl req -x509 -new ' | 163 system('openssl req -x509 -new ' |
164 . "-config '$d/openssl.conf' -subj '/CN=issuer/' " | 164 . "-config $d/openssl.conf -subj /CN=issuer/ " |
165 . "-out '$d/issuer.crt' -keyout '$d/issuer.key' " | 165 . "-out $d/issuer.crt -keyout $d/issuer.key " |
166 . ">>$d/openssl.out 2>&1") == 0 | 166 . ">>$d/openssl.out 2>&1") == 0 |
167 or die "Can't create certificate for issuer: $!\n"; | 167 or die "Can't create certificate for issuer: $!\n"; |
168 | 168 |
169 system("openssl req -new " | 169 system("openssl req -new " |
170 . "-config '$d/openssl.conf' -subj '/CN=subject/' " | 170 . "-config $d/openssl.conf -subj /CN=subject/ " |
171 . "-out '$d/subject.csr' -keyout '$d/subject.key' " | 171 . "-out $d/subject.csr -keyout $d/subject.key " |
172 . ">>$d/openssl.out 2>&1") == 0 | 172 . ">>$d/openssl.out 2>&1") == 0 |
173 or die "Can't create certificate for subject: $!\n"; | 173 or die "Can't create certificate for subject: $!\n"; |
174 | 174 |
175 system("openssl ca -batch -config '$d/ca.conf' " | 175 system("openssl ca -batch -config $d/ca.conf " |
176 . "-keyfile '$d/issuer.key' -cert '$d/issuer.crt' " | 176 . "-keyfile $d/issuer.key -cert $d/issuer.crt " |
177 . "-subj '/CN=subject/' -in '$d/subject.csr' -out '$d/subject.crt' " | 177 . "-subj /CN=subject/ -in $d/subject.csr -out $d/subject.crt " |
178 . ">>$d/openssl.out 2>&1") == 0 | 178 . ">>$d/openssl.out 2>&1") == 0 |
179 or die "Can't sign certificate for subject: $!\n"; | 179 or die "Can't sign certificate for subject: $!\n"; |
180 | 180 |
181 foreach my $name ('localhost', 'inner') { | 181 foreach my $name ('localhost', 'inner') { |
182 system('openssl req -x509 -new ' | 182 system('openssl req -x509 -new ' |
183 . "-config '$d/openssl.conf' -subj '/CN=$name/' " | 183 . "-config $d/openssl.conf -subj /CN=$name/ " |
184 . "-out '$d/$name.crt' -keyout '$d/$name.key' " | 184 . "-out $d/$name.crt -keyout $d/$name.key " |
185 . ">>$d/openssl.out 2>&1") == 0 | 185 . ">>$d/openssl.out 2>&1") == 0 |
186 or die "Can't create certificate for $name: $!\n"; | 186 or die "Can't create certificate for $name: $!\n"; |
187 } | 187 } |
188 | 188 |
189 my $ctx = new IO::Socket::SSL::SSL_Context( | 189 my $ctx = new IO::Socket::SSL::SSL_Context( |