Skip to content

Commit f21b3db

Browse files
bavshin-f5pluknet
authored andcommitted
Tests: removed OpenSC dependency from ssl_engine_keys.t.
1 parent c747dfa commit f21b3db

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

ssl_engine_keys.t

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ plan(skip_all => 'may not work, leaves coredump')
2828
unless $ENV{TEST_NGINX_UNSAFE};
2929

3030
my $t = Test::Nginx->new()->has(qw/http proxy http_ssl/)->has_daemon('openssl')
31-
->has_daemon('softhsm2-util')->has_daemon('pkcs11-tool');
31+
->has_daemon('softhsm2-util');
3232

3333
$t->write_file_expand('nginx.conf', <<'EOF');
3434
@@ -151,9 +151,14 @@ foreach my $name ('localhost') {
151151
. '--pin 1234 --so-pin 1234 '
152152
. ">>$d/openssl.out 2>&1");
153153

154-
system("pkcs11-tool --module=$libsofthsm2_path "
155-
. '-p 1234 -l -k -d 0 -a nx_key_0 --key-type rsa:2048 '
156-
. ">>$d/openssl.out 2>&1");
154+
system("openssl genrsa -out $d/$name.key 2048 "
155+
. ">>$d/openssl.out 2>&1") == 0
156+
or die "Can't create private key: $!\n";
157+
158+
system("softhsm2-util --import $d/$name.key --id 00 --label nx_key_0 "
159+
. '--token NginxZero --pin 1234 '
160+
. ">>$d/openssl.out 2>&1") == 0
161+
or die "Can't import private key: $!\n";
157162

158163
system('openssl req -x509 -new '
159164
. "-subj /CN=$name/ -out $d/$name.crt -text "

0 commit comments

Comments
 (0)