Mercurial > hg > nginx-tests
comparison stream_ssl_preread_protocol.t @ 1358:71f964c077bf
Tests: adjusted ssl_preread_protocol tests with V2ClientHello.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 19 Jul 2018 13:07:22 +0300 |
parents | 2415ef05a282 |
children | 144c6ce732e4 |
comparison
equal
deleted
inserted
replaced
1357:2415ef05a282 | 1358:71f964c077bf |
---|---|
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 EOF | 43 EOF |
44 | 44 |
45 $t->try_run('no ssl_preread_protocol')->plan(6); | 45 $t->try_run('no ssl_preread_protocol')->plan(7); |
46 | 46 |
47 ############################################################################### | 47 ############################################################################### |
48 | 48 |
49 is(get('SSLv3'), 'SSLv3', 'client hello SSLv3'); | 49 is(get('SSLv3'), 'SSLv3', 'client hello SSLv3'); |
50 is(get('TLSv1'), 'TLSv1', 'client hello TLSv1'); | 50 is(get('TLSv1'), 'TLSv1', 'client hello TLSv1'); |
51 is(get('TLSv1.1'), 'TLSv1.1', 'client hello TLSv1.1'); | 51 is(get('TLSv1.1'), 'TLSv1.1', 'client hello TLSv1.1'); |
52 is(get('TLSv1.2'), 'TLSv1.2', 'client hello TLSv1.2'); | 52 is(get('TLSv1.2'), 'TLSv1.2', 'client hello TLSv1.2'); |
53 | 53 |
54 is(get_tls13(), 'TLSv1.3', 'client hello supported_versions'); | 54 is(get_tls13(), 'TLSv1.3', 'client hello supported_versions'); |
55 | 55 |
56 TODO: { | 56 is(get_ssl2('SSLv2'), 'SSLv2', 'client hello version 2'); |
57 local $TODO = 'not yet'; | 57 is(get_ssl2('TLSv1'), 'TLSv1', 'client hello version 2 - TLSv1'); |
58 | |
59 is(get_ssl2(), 'SSLv2', 'client hello version 2'); | |
60 | |
61 } | |
62 | 58 |
63 ############################################################################### | 59 ############################################################################### |
64 | 60 |
65 sub get { | 61 sub get { |
66 my $v = shift; | 62 my $v = shift; |
89 | 85 |
90 http($r); | 86 http($r); |
91 } | 87 } |
92 | 88 |
93 sub get_ssl2 { | 89 sub get_ssl2 { |
94 my $r = pack("nCn4", 0x801c, 0x01, 0x0002, 0x0003, 0x0000, 0x0010); | 90 my $v = shift; |
91 my $ch; | |
92 | |
93 $ch = 0x0002 if $v eq 'SSLv2'; | |
94 $ch = 0x0301 if $v eq 'TLSv1'; | |
95 | |
96 my $r = pack("nCn4", 0x801c, 0x01, $ch, 0x0003, 0x0000, 0x0010); | |
95 $r .= pack("C3", 0x01, 0x00, 0x80); | 97 $r .= pack("C3", 0x01, 0x00, 0x80); |
96 $r .= pack("N4", 0x322dd95c, 0x4749ef17, 0x3d5f0916, 0xf0b730f8); | 98 $r .= pack("N4", 0x322dd95c, 0x4749ef17, 0x3d5f0916, 0xf0b730f8); |
97 | 99 |
98 http($r); | 100 http($r); |
99 } | 101 } |