2 # Copyright 2016-2016 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
10 ## Test version negotiation
20 name => "alpn-simple",
23 "ALPNProtocols" => "foo",
28 "ALPNProtocols" => "foo",
32 "ExpectedALPNProtocol" => "foo",
36 name => "alpn-server-finds-match",
39 "ALPNProtocols" => "baz,bar",
44 "ALPNProtocols" => "foo,bar",
48 "ExpectedALPNProtocol" => "bar",
52 name => "alpn-server-honours-server-pref",
55 "ALPNProtocols" => "bar,foo",
60 "ALPNProtocols" => "foo,bar",
64 "ExpectedALPNProtocol" => "bar",
68 name => "alpn-alert-on-mismatch",
71 "ALPNProtocols" => "baz",
76 "ALPNProtocols" => "foo,bar",
80 "ExpectedResult" => "ServerFail",
81 "ExpectedServerAlert" => "NoApplicationProtocol",
85 name => "alpn-no-server-support",
89 "ALPNProtocols" => "foo",
93 "ExpectedALPNProtocol" => undef,
97 name => "alpn-no-client-support",
100 "ALPNProtocols" => "foo",
105 "ExpectedALPNProtocol" => undef,
109 name => "alpn-with-sni-no-context-switch",
112 "ALPNProtocols" => "foo",
113 "ServerNameCallback" => "IgnoreMismatch",
118 "ALPNProtocols" => "bar",
123 "ALPNProtocols" => "foo,bar",
124 "ServerName" => "server1",
128 "ExpectedServerName" => "server1",
129 "ExpectedALPNProtocol" => "foo",
133 name => "alpn-with-sni-context-switch",
136 "ALPNProtocols" => "foo",
137 "ServerNameCallback" => "IgnoreMismatch",
142 "ALPNProtocols" => "bar",
147 "ALPNProtocols" => "foo,bar",
148 "ServerName" => "server2",
152 "ExpectedServerName" => "server2",
153 "ExpectedALPNProtocol" => "bar",
157 name => "alpn-selected-sni-server-supports-alpn",
160 "ServerNameCallback" => "IgnoreMismatch",
165 "ALPNProtocols" => "bar",
170 "ALPNProtocols" => "foo,bar",
171 "ServerName" => "server2",
175 "ExpectedServerName" => "server2",
176 "ExpectedALPNProtocol" => "bar",
180 name => "alpn-selected-sni-server-does-not-support-alpn",
183 "ALPNProtocols" => "bar",
184 "ServerNameCallback" => "IgnoreMismatch",
190 "ALPNProtocols" => "foo,bar",
191 "ServerName" => "server2",
195 "ExpectedServerName" => "server2",
196 "ExpectedALPNProtocol" => undef,
200 name => "alpn-simple-resumption",
203 "ALPNProtocols" => "foo",
208 "ALPNProtocols" => "foo",
212 "HandshakeMode" => "Resume",
213 "ResumptionExpected" => "Yes",
214 "ExpectedALPNProtocol" => "foo",
218 name => "alpn-server-switch-resumption",
221 "ALPNProtocols" => "bar,foo",
226 "ALPNProtocols" => "baz,foo",
231 "ALPNProtocols" => "foo,bar,baz",
235 "HandshakeMode" => "Resume",
236 "ResumptionExpected" => "Yes",
237 "ExpectedALPNProtocol" => "baz",
241 name => "alpn-client-switch-resumption",
244 "ALPNProtocols" => "foo,bar,baz",
249 "ALPNProtocols" => "foo,baz",
254 "ALPNProtocols" => "bar,baz",
258 "HandshakeMode" => "Resume",
259 "ResumptionExpected" => "Yes",
260 "ExpectedALPNProtocol" => "bar",
264 name => "alpn-alert-on-mismatch-resumption",
267 "ALPNProtocols" => "bar",
272 "ALPNProtocols" => "baz",
277 "ALPNProtocols" => "foo,bar",
281 "HandshakeMode" => "Resume",
282 "ExpectedResult" => "ServerFail",
283 "ExpectedServerAlert" => "NoApplicationProtocol",
287 name => "alpn-no-server-support-resumption",
290 "ALPNProtocols" => "foo",
293 resume_server => { },
296 "ALPNProtocols" => "foo",
300 "HandshakeMode" => "Resume",
301 "ResumptionExpected" => "Yes",
302 "ExpectedALPNProtocol" => undef,
306 name => "alpn-no-client-support-resumption",
309 "ALPNProtocols" => "foo",
314 "ALPNProtocols" => "foo",
320 "HandshakeMode" => "Resume",
321 "ResumptionExpected" => "Yes",
322 "ExpectedALPNProtocol" => undef,