Mercurial > hg > nginx-tests
comparison stream_ssl_preread_alpn.t @ 1307:23026106e439
Tests: unbreak stream_ssl_preread_alpn.t on OpenSSL < 1.0.2h.
Do not check return value for empty ALPN test case, since older OpenSSL
versions tolerate empty strings. The test is still useful for coverage.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 22 Mar 2018 14:18:33 +0300 |
parents | 5e9695bd370a |
children | 97c8280de681 |
comparison
equal
deleted
inserted
replaced
1306:5e9695bd370a | 1307:23026106e439 |
---|---|
98 . "-out $d/$name.crt -keyout $d/$name.key " | 98 . "-out $d/$name.crt -keyout $d/$name.key " |
99 . ">>$d/openssl.out 2>&1") == 0 | 99 . ">>$d/openssl.out 2>&1") == 0 |
100 or die "Can't create certificate for $name: $!\n"; | 100 or die "Can't create certificate for $name: $!\n"; |
101 } | 101 } |
102 | 102 |
103 $t->try_run('no ssl_preread_alpn_protocols')->plan(6); | 103 $t->try_run('no ssl_preread_alpn_protocols')->plan(5); |
104 | 104 |
105 ############################################################################### | 105 ############################################################################### |
106 | 106 |
107 my ($p1, $p2, $p3) = (port(8091), port(8092), port(8093)); | 107 my ($p1, $p2, $p3) = (port(8091), port(8092), port(8093)); |
108 | 108 |
112 is(get_ssl(8081, 'bar'), $p2, 'alpn 2'); | 112 is(get_ssl(8081, 'bar'), $p2, 'alpn 2'); |
113 is(get_ssl(8081, 'bar'), $p2, 'alpn 2 again'); | 113 is(get_ssl(8081, 'bar'), $p2, 'alpn 2 again'); |
114 | 114 |
115 is(get_ssl(8081, 'foo', 'bar'), $p3, 'alpn many'); | 115 is(get_ssl(8081, 'foo', 'bar'), $p3, 'alpn many'); |
116 | 116 |
117 # fallback to an empty value | 117 get_ssl(8081, ''); |
118 | |
119 ok(!get_ssl(8081, ''), 'alpn empty'); | |
120 | 118 |
121 ############################################################################### | 119 ############################################################################### |
122 | 120 |
123 sub get_ssl { | 121 sub get_ssl { |
124 my ($port, @alpn) = @_; | 122 my ($port, @alpn) = @_; |