Mercurial > hg > nginx-tests
comparison proxy_ssl.t @ 1523:5a55da6aed13
Tests: extended proxy_ssl.t for more ngx_ssl_recv_chain() cases.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 18 Oct 2019 17:17:51 +0300 |
parents | dbce8fb5f5f8 |
children | ebc6e5afe597 |
comparison
equal
deleted
inserted
replaced
1522:d8684b300d22 | 1523:5a55da6aed13 |
---|---|
23 | 23 |
24 eval { require IO::Socket::SSL; }; | 24 eval { require IO::Socket::SSL; }; |
25 plan(skip_all => 'IO::Socket::SSL not installed') if $@; | 25 plan(skip_all => 'IO::Socket::SSL not installed') if $@; |
26 | 26 |
27 my $t = Test::Nginx->new()->has(qw/http proxy http_ssl/)->has_daemon('openssl') | 27 my $t = Test::Nginx->new()->has(qw/http proxy http_ssl/)->has_daemon('openssl') |
28 ->plan(7)->write_file_expand('nginx.conf', <<'EOF'); | 28 ->plan(8)->write_file_expand('nginx.conf', <<'EOF'); |
29 | 29 |
30 %%TEST_GLOBALS%% | 30 %%TEST_GLOBALS%% |
31 | 31 |
32 daemon off; | 32 daemon off; |
33 | 33 |
83 encrypt_key = no | 83 encrypt_key = no |
84 distinguished_name = req_distinguished_name | 84 distinguished_name = req_distinguished_name |
85 [ req_distinguished_name ] | 85 [ req_distinguished_name ] |
86 EOF | 86 EOF |
87 | 87 |
88 $t->write_file('big.html', 'xxxxxxxxxx' x 72000); | |
88 $t->write_file('index.html', ''); | 89 $t->write_file('index.html', ''); |
89 | 90 |
90 my $d = $t->testdir(); | 91 my $d = $t->testdir(); |
91 | 92 |
92 foreach my $name ('localhost') { | 93 foreach my $name ('localhost') { |
117 like(http_get('/timeout'), qr/200 OK/, 'proxy connect timeout'); | 118 like(http_get('/timeout'), qr/200 OK/, 'proxy connect timeout'); |
118 | 119 |
119 } | 120 } |
120 | 121 |
121 like(http_get('/timeout_h'), qr/504 Gateway/, 'proxy handshake timeout'); | 122 like(http_get('/timeout_h'), qr/504 Gateway/, 'proxy handshake timeout'); |
123 | |
124 is(length(Test::Nginx::http_content(http_get('/ssl/big.html'))), 720000, | |
125 'big length'); | |
122 | 126 |
123 ############################################################################### | 127 ############################################################################### |
124 | 128 |
125 sub http_daemon { | 129 sub http_daemon { |
126 my ($port) = @_; | 130 my ($port) = @_; |