# HG changeset patch # User Sergey Kandaurov # Date 1551362544 -10800 # Node ID 44973a23b03150cd11c08bae078a270644078b27 # Parent 889283abadf83c2825063a39fb265d85e954c5e1 Tests: loading "engine:..." keys with certificate variable. diff --git a/ssl_engine_keys.t b/ssl_engine_keys.t --- a/ssl_engine_keys.t +++ b/ssl_engine_keys.t @@ -28,7 +28,7 @@ plan(skip_all => 'may not work, leaves c unless $ENV{TEST_NGINX_UNSAFE}; my $t = Test::Nginx->new()->has(qw/http proxy http_ssl/)->has_daemon('openssl') - ->has_daemon('softhsm')->has_daemon('pkcs11-tool')->plan(1); + ->has_daemon('softhsm')->has_daemon('pkcs11-tool'); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -53,9 +53,28 @@ http { location / { # index index.html by default } + location /proxy { proxy_pass https://127.0.0.1:8081/; } + + location /var { + proxy_pass https://127.0.0.1:8082/; + proxy_ssl_name localhost; + proxy_ssl_server_name on; + } + } + + server { + listen 127.0.0.1:8082 ssl; + server_name localhost; + + ssl_certificate $ssl_server_name.crt; + ssl_certificate_key engine:pkcs11:slot_0-id_00; + + location / { + # index index.html by default + } } } @@ -118,12 +137,13 @@ foreach my $name ('localhost') { or die "Can't create certificate for $name: $!\n"; } -$t->run(); +$t->try_run('no ssl_certificate variables')->plan(2); $t->write_file('index.html', ''); ############################################################################### like(http_get('/proxy'), qr/200 OK/, 'ssl engine keys'); +like(http_get('/var'), qr/200 OK/, 'ssl_certificate with variable'); ###############################################################################