2 # Copyright 2016-2016 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the OpenSSL license (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",
207 #TODO(TLS1.3): Temporary until we support TLSv1.3 resumption
208 MaxProtocol => "TLSv1.2",
210 "ALPNProtocols" => "foo",
214 "HandshakeMode" => "Resume",
215 "ResumptionExpected" => "Yes",
216 "ExpectedALPNProtocol" => "foo",
220 name => "alpn-server-switch-resumption",
223 "ALPNProtocols" => "bar,foo",
228 "ALPNProtocols" => "baz,foo",
232 #TODO(TLS1.3): Temporary until we support TLSv1.3 resumption
233 MaxProtocol => "TLSv1.2",
235 "ALPNProtocols" => "foo,bar,baz",
239 "HandshakeMode" => "Resume",
240 "ResumptionExpected" => "Yes",
241 "ExpectedALPNProtocol" => "baz",
245 name => "alpn-client-switch-resumption",
248 "ALPNProtocols" => "foo,bar,baz",
252 #TODO(TLS1.3): Temporary until we support TLSv1.3 resumption
253 MaxProtocol => "TLSv1.2",
255 "ALPNProtocols" => "foo,baz",
259 #TODO(TLS1.3): Temporary until we support TLSv1.3 resumption
260 MaxProtocol => "TLSv1.2",
262 "ALPNProtocols" => "bar,baz",
266 "HandshakeMode" => "Resume",
267 "ResumptionExpected" => "Yes",
268 "ExpectedALPNProtocol" => "bar",
272 name => "alpn-alert-on-mismatch-resumption",
275 "ALPNProtocols" => "bar",
280 "ALPNProtocols" => "baz",
284 #TODO(TLS1.3): Temporary until we support TLSv1.3 resumption
285 MaxProtocol => "TLSv1.2",
287 "ALPNProtocols" => "foo,bar",
291 "HandshakeMode" => "Resume",
292 "ExpectedResult" => "ServerFail",
293 "ExpectedServerAlert" => "NoApplicationProtocol",
297 name => "alpn-no-server-support-resumption",
300 "ALPNProtocols" => "foo",
303 resume_server => { },
305 #TODO(TLS1.3): Temporary until we support TLSv1.3 resumption
306 MaxProtocol => "TLSv1.2",
308 "ALPNProtocols" => "foo",
312 "HandshakeMode" => "Resume",
313 "ResumptionExpected" => "Yes",
314 "ExpectedALPNProtocol" => undef,
318 name => "alpn-no-client-support-resumption",
321 "ALPNProtocols" => "foo",
325 #TODO(TLS1.3): Temporary until we support TLSv1.3 resumption
326 MaxProtocol => "TLSv1.2",
328 "ALPNProtocols" => "foo",
332 #TODO(TLS1.3): Temporary until we support TLSv1.3 resumption
333 MaxProtocol => "TLSv1.2"
336 "HandshakeMode" => "Resume",
337 "ResumptionExpected" => "Yes",
338 "ExpectedALPNProtocol" => undef,