# HG changeset patch # User Sergey Kandaurov # Date 1593508260 -10800 # Node ID f55d25e08b3edaab6f3a30a000ac486334994978 # Parent 804a7409bc63e8b7e3ad4c66152b7d86610a84aa Tests: added "ssl_verify_client off" tests (ticket #2008). diff --git a/ssl_verify_client.t b/ssl_verify_client.t --- a/ssl_verify_client.t +++ b/ssl_verify_client.t @@ -40,7 +40,7 @@ eval { plan(skip_all => 'Net::SSLeay with OpenSSL SNI support required') if $@; my $t = Test::Nginx->new()->has(qw/http http_ssl sni/) - ->has_daemon('openssl')->plan(11); + ->has_daemon('openssl')->plan(13); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -95,6 +95,18 @@ http { server { listen 127.0.0.1:8081 ssl; + server_name off; + + ssl_certificate_key 1.example.com.key; + ssl_certificate 1.example.com.crt; + + ssl_verify_client off; + ssl_client_certificate 2.example.com.crt; + ssl_trusted_certificate 3.example.com.crt; + } + + server { + listen 127.0.0.1:8081 ssl; server_name optional.no.ca; ssl_certificate_key 1.example.com.key; @@ -147,6 +159,8 @@ like(get('optional'), qr/NONE:x/, 'no op like(get('optional', '1.example.com'), qr/400 Bad/, 'bad optional cert'); like(get('optional.no.ca', '1.example.com'), qr/FAILED.*BEGIN/, 'bad optional_no_ca cert'); +like(get('off', '2.example.com'), qr/NONE/, 'off cert'); +like(get('off', '3.example.com'), qr/NONE/, 'off cert trusted'); like(get('localhost', '2.example.com'), qr/SUCCESS.*BEGIN/, 'good cert'); like(get('optional', '2.example.com'), qr/SUCCESS.*BEGI/, 'good cert optional');