comparison ssl2.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
96 96
97 $t->write_file('certserial', '1000'); 97 $t->write_file('certserial', '1000');
98 $t->write_file('certindex', ''); 98 $t->write_file('certindex', '');
99 99
100 system('openssl req -x509 -new ' 100 system('openssl req -x509 -new '
101 . "-config '$d/openssl.conf' -subj '/CN=issuer/' " 101 . "-config $d/openssl.conf -subj /CN=issuer/ "
102 . "-out '$d/issuer.crt' -keyout '$d/issuer.key' " 102 . "-out $d/issuer.crt -keyout $d/issuer.key "
103 . ">>$d/openssl.out 2>&1") == 0 103 . ">>$d/openssl.out 2>&1") == 0
104 or die "Can't create certificate for issuer: $!\n"; 104 or die "Can't create certificate for issuer: $!\n";
105 105
106 system("openssl req -new " 106 system("openssl req -new "
107 . "-config '$d/openssl.conf' -subj '/CN=subject/' " 107 . "-config $d/openssl.conf -subj /CN=subject/ "
108 . "-out '$d/subject.csr' -keyout '$d/subject.key' " 108 . "-out $d/subject.csr -keyout $d/subject.key "
109 . ">>$d/openssl.out 2>&1") == 0 109 . ">>$d/openssl.out 2>&1") == 0
110 or die "Can't create certificate for subject: $!\n"; 110 or die "Can't create certificate for subject: $!\n";
111 111
112 system("openssl ca -batch -config '$d/ca.conf' " 112 system("openssl ca -batch -config $d/ca.conf "
113 . "-keyfile '$d/issuer.key' -cert '$d/issuer.crt' " 113 . "-keyfile $d/issuer.key -cert $d/issuer.crt "
114 . "-subj '/CN=subject/' -in '$d/subject.csr' -out '$d/subject.crt' " 114 . "-subj /CN=subject/ -in $d/subject.csr -out $d/subject.crt "
115 . ">>$d/openssl.out 2>&1") == 0 115 . ">>$d/openssl.out 2>&1") == 0
116 or die "Can't sign certificate for subject: $!\n"; 116 or die "Can't sign certificate for subject: $!\n";
117 117
118 foreach my $name ('localhost') { 118 foreach my $name ('localhost') {
119 system('openssl req -x509 -new ' 119 system('openssl req -x509 -new '
120 . "-config '$d/openssl.conf' -subj '/CN=$name/' " 120 . "-config $d/openssl.conf -subj /CN=$name/ "
121 . "-out '$d/$name.crt' -keyout '$d/$name.key' " 121 . "-out $d/$name.crt -keyout $d/$name.key "
122 . ">>$d/openssl.out 2>&1") == 0 122 . ">>$d/openssl.out 2>&1") == 0
123 or die "Can't create certificate for $name: $!\n"; 123 or die "Can't create certificate for $name: $!\n";
124 } 124 }
125 125
126 $t->try_run('no ssl_ciphers')->plan(4); 126 $t->try_run('no ssl_ciphers')->plan(4);