comparison ssl_verify_depth.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 5b22e2014f76
children 8c764fd93b5e
comparison
equal deleted inserted replaced
1219:f373a718f646 1220:0af58b78df35
85 commonName = supplied 85 commonName = supplied
86 EOF 86 EOF
87 87
88 foreach my $name ('root', 'localhost') { 88 foreach my $name ('root', 'localhost') {
89 system('openssl req -x509 -new ' 89 system('openssl req -x509 -new '
90 . "-config '$d/openssl.conf' -subj '/CN=$name/' " 90 . "-config $d/openssl.conf -subj /CN=$name/ "
91 . "-out '$d/$name.crt' -keyout '$d/$name.key' " 91 . "-out $d/$name.crt -keyout $d/$name.key "
92 . ">>$d/openssl.out 2>&1") == 0 92 . ">>$d/openssl.out 2>&1") == 0
93 or die "Can't create certificate for $name: $!\n"; 93 or die "Can't create certificate for $name: $!\n";
94 } 94 }
95 95
96 foreach my $name ('int', 'end') { 96 foreach my $name ('int', 'end') {
97 system("openssl req -new " 97 system("openssl req -new "
98 . "-config '$d/openssl.conf' -subj '/CN=$name/' " 98 . "-config $d/openssl.conf -subj /CN=$name/ "
99 . "-out '$d/$name.csr' -keyout '$d/$name.key' " 99 . "-out $d/$name.csr -keyout $d/$name.key "
100 . ">>$d/openssl.out 2>&1") == 0 100 . ">>$d/openssl.out 2>&1") == 0
101 or die "Can't create certificate for $name: $!\n"; 101 or die "Can't create certificate for $name: $!\n";
102 } 102 }
103 103
104 $t->write_file('certserial', '1000'); 104 $t->write_file('certserial', '1000');
105 $t->write_file('certindex', ''); 105 $t->write_file('certindex', '');
106 106
107 system("openssl ca -batch -config '$d/ca.conf' " 107 system("openssl ca -batch -config $d/ca.conf "
108 . "-keyfile '$d/root.key' -cert '$d/root.crt' " 108 . "-keyfile $d/root.key -cert $d/root.crt "
109 . "-subj '/CN=int/' -in '$d/int.csr' -out '$d/int.crt' " 109 . "-subj /CN=int/ -in $d/int.csr -out $d/int.crt "
110 . ">>$d/openssl.out 2>&1") == 0 110 . ">>$d/openssl.out 2>&1") == 0
111 or die "Can't sign certificate for int: $!\n"; 111 or die "Can't sign certificate for int: $!\n";
112 112
113 system("openssl ca -batch -config '$d/ca.conf' " 113 system("openssl ca -batch -config $d/ca.conf "
114 . "-keyfile '$d/int.key' -cert '$d/int.crt' " 114 . "-keyfile $d/int.key -cert $d/int.crt "
115 . "-subj '/CN=end/' -in '$d/end.csr' -out '$d/end.crt' " 115 . "-subj /CN=end/ -in $d/end.csr -out $d/end.crt "
116 . ">>$d/openssl.out 2>&1") == 0 116 . ">>$d/openssl.out 2>&1") == 0
117 or die "Can't sign certificate for end: $!\n"; 117 or die "Can't sign certificate for end: $!\n";
118 118
119 $t->write_file('int-root.crt', 119 $t->write_file('int-root.crt',
120 $t->read_file('int.crt') . $t->read_file('root.crt')); 120 $t->read_file('int.crt') . $t->read_file('root.crt'));