Mercurial > hg > nginx-tests
annotate uwsgi_ssl_certificate_vars.t @ 1971:ab45ee8011df
Tests: guarded session ticket tests for old OpenSSL versions.
Much like SNI support, TLS session tickets are available starting with
OpenSSL 0.9.8f if TLS extensions support is explicitly configured, and
enabled by default since 0.9.8j. As such, SNI availability is checked
to ensure TLS extensions support is compiled in.
Additionally, the ssl_session_ticket_key.t tests for automatic ticket key
rotation, which uses session ticket key callback, as introduced in
OpenSSL 0.9.8h.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 06 May 2024 00:03:16 +0300 |
parents | 2a0a6035a1af |
children | b5036a0f9ae0 |
rev | line source |
---|---|
1688
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
2 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
3 # (C) Sergey Kandaurov |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
4 # (C) Nginx, Inc. |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
5 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
6 # Tests for http uwsgi module with variables in ssl certificates. |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
7 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
8 ############################################################################### |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
9 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
10 use warnings; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
11 use strict; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
12 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
13 use Test::More; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
14 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
15 BEGIN { use FindBin; chdir($FindBin::Bin); } |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
16 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
17 use lib 'lib'; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
18 use Test::Nginx; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
19 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
20 ############################################################################### |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
21 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
22 select STDERR; $| = 1; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
23 select STDOUT; $| = 1; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
24 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
25 my $t = Test::Nginx->new()->has(qw/http http_ssl uwsgi/) |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
26 ->has_daemon('openssl'); |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
27 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
28 $t->write_file_expand('nginx.conf', <<'EOF'); |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
29 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
30 %%TEST_GLOBALS%% |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
31 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
32 daemon off; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
33 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
34 events { |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
35 } |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
36 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
37 http { |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
38 %%TEST_GLOBALS_HTTP%% |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
39 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
40 server { |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
41 listen 127.0.0.1:8080; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
42 server_name localhost; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
43 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
44 uwsgi_ssl_session_reuse off; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
45 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
46 location / { |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
47 uwsgi_pass suwsgi://127.0.0.1:8081; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
48 uwsgi_ssl_certificate $arg_cert.example.com.crt; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
49 uwsgi_ssl_certificate_key $arg_cert.example.com.key; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
50 } |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
51 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
52 location /encrypted { |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
53 uwsgi_pass suwsgi://127.0.0.1:8082; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
54 uwsgi_ssl_certificate $arg_cert.example.com.crt; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
55 uwsgi_ssl_certificate_key $arg_cert.example.com.key; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
56 uwsgi_ssl_password_file password; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
57 } |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
58 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
59 location /none { |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
60 uwsgi_pass suwsgi://127.0.0.1:8082; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
61 uwsgi_ssl_certificate $arg_cert; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
62 uwsgi_ssl_certificate_key $arg_cert; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
63 } |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
64 } |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
65 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
66 # stub to implement SSL logic for tests |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
67 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
68 server { |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
69 listen 127.0.0.1:8081 ssl; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
70 server_name localhost; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
71 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
72 ssl_certificate 2.example.com.crt; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
73 ssl_certificate_key 2.example.com.key; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
74 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
75 ssl_verify_client optional_no_ca; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
76 ssl_trusted_certificate 1.example.com.crt; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
77 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
78 add_header X-Verify $ssl_client_verify always; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
79 add_header X-Name $ssl_client_s_dn always; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
80 } |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
81 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
82 server { |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
83 listen 127.0.0.1:8082 ssl; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
84 server_name localhost; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
85 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
86 ssl_certificate 1.example.com.crt; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
87 ssl_certificate_key 1.example.com.key; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
88 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
89 ssl_verify_client optional_no_ca; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
90 ssl_trusted_certificate 3.example.com.crt; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
91 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
92 add_header X-Verify $ssl_client_verify always; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
93 } |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
94 } |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
95 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
96 EOF |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
97 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
98 $t->write_file('openssl.conf', <<EOF); |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
99 [ req ] |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
100 default_bits = 2048 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
101 encrypt_key = no |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
102 distinguished_name = req_distinguished_name |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
103 [ req_distinguished_name ] |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
104 EOF |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
105 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
106 my $d = $t->testdir(); |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
107 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
108 foreach my $name ('1.example.com', '2.example.com') { |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
109 system('openssl req -x509 -new ' |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
110 . "-config $d/openssl.conf -subj /CN=$name/ " |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
111 . "-out $d/$name.crt -keyout $d/$name.key " |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
112 . ">>$d/openssl.out 2>&1") == 0 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
113 or die "Can't create certificate for $name: $!\n"; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
114 } |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
115 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
116 foreach my $name ('3.example.com') { |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
117 system("openssl genrsa -out $d/$name.key -passout pass:$name " |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
118 . "-aes128 2048 >>$d/openssl.out 2>&1") == 0 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
119 or die "Can't create private key: $!\n"; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
120 system('openssl req -x509 -new ' |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
121 . "-config $d/openssl.conf -subj /CN=$name/ " |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
122 . "-out $d/$name.crt " |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
123 . "-key $d/$name.key -passin pass:$name" |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
124 . ">>$d/openssl.out 2>&1") == 0 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
125 or die "Can't create certificate for $name: $!\n"; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
126 } |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
127 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
128 sleep 1 if $^O eq 'MSWin32'; |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
129 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
130 $t->write_file('password', '3.example.com'); |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
131 $t->write_file('index.html', ''); |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
132 |
1937
2a0a6035a1af
Tests: removed TODO and try_run() checks for legacy versions.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1688
diff
changeset
|
133 $t->run()->plan(4); |
1688
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
134 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
135 ############################################################################### |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
136 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
137 like(http_get('/?cert=1'), |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
138 qr/X-Verify: SUCCESS/ms, 'variable - verify certificate'); |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
139 like(http_get('/?cert=2'), |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
140 qr/X-Verify: FAILED/ms, 'variable - fail certificate'); |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
141 like(http_get('/encrypted?cert=3'), |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
142 qr/X-Verify: SUCCESS/ms, 'variable - with encrypted key'); |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
143 like(http_get('/none'), |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
144 qr/X-Verify: NONE/ms, 'variable - no certificate'); |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
145 |
31ea330ac360
Tests: more uwsgi tests with SSL.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
146 ############################################################################### |