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
23 "NPNProtocols" => "foo",
28 "NPNProtocols" => "foo",
32 "ExpectedNPNProtocol" => "foo",
36 name => "npn-client-finds-match",
39 "NPNProtocols" => "baz,bar",
44 "NPNProtocols" => "foo,bar",
48 "ExpectedNPNProtocol" => "bar",
52 name => "npn-client-honours-server-pref",
55 "NPNProtocols" => "bar,foo",
60 "NPNProtocols" => "foo,bar",
64 "ExpectedNPNProtocol" => "bar",
68 name => "npn-client-first-pref-on-mismatch",
71 "NPNProtocols" => "baz",
76 "NPNProtocols" => "foo,bar",
80 "ExpectedNPNProtocol" => "foo",
84 name => "npn-no-server-support",
88 "NPNProtocols" => "foo",
92 "ExpectedNPNProtocol" => undef,
96 name => "npn-no-client-support",
99 "NPNProtocols" => "foo",
104 "ExpectedNPNProtocol" => undef,
108 name => "npn-with-sni-no-context-switch",
111 "NPNProtocols" => "foo",
112 "ServerNameCallback" => "IgnoreMismatch",
117 "NPNProtocols" => "bar",
122 "NPNProtocols" => "foo,bar",
123 "ServerName" => "server1",
127 "ExpectedServerName" => "server1",
128 "ExpectedNPNProtocol" => "foo",
132 name => "npn-with-sni-context-switch",
135 "NPNProtocols" => "foo",
136 "ServerNameCallback" => "IgnoreMismatch",
141 "NPNProtocols" => "bar",
146 "NPNProtocols" => "foo,bar",
147 "ServerName" => "server2",
151 "ExpectedServerName" => "server2",
152 "ExpectedNPNProtocol" => "bar",
156 name => "npn-selected-sni-server-supports-npn",
159 "ServerNameCallback" => "IgnoreMismatch",
164 "NPNProtocols" => "bar",
169 "NPNProtocols" => "foo,bar",
170 "ServerName" => "server2",
174 "ExpectedServerName" => "server2",
175 "ExpectedNPNProtocol" => "bar",
179 name => "npn-selected-sni-server-does-not-support-npn",
182 "NPNProtocols" => "bar",
183 "ServerNameCallback" => "IgnoreMismatch",
189 "NPNProtocols" => "foo,bar",
190 "ServerName" => "server2",
194 "ExpectedServerName" => "server2",
195 "ExpectedNPNProtocol" => undef,
199 name => "alpn-preferred-over-npn",
202 "ALPNProtocols" => "foo",
203 "NPNProtocols" => "bar",
208 "ALPNProtocols" => "foo",
209 "NPNProtocols" => "bar",
213 "ExpectedALPNProtocol" => "foo",
214 "ExpectedNPNProtocol" => undef,
218 name => "sni-npn-preferred-over-alpn",
221 "ServerNameCallback" => "IgnoreMismatch",
222 "ALPNProtocols" => "foo",
227 "NPNProtocols" => "bar",
232 "ServerName" => "server2",
233 "ALPNProtocols" => "foo",
234 "NPNProtocols" => "bar",
238 "ExpectedALPNProtocol" => undef,
239 "ExpectedNPNProtocol" => "bar",
240 "ExpectedServerName" => "server2",
244 name => "npn-simple-resumption",
247 "NPNProtocols" => "foo",
252 "NPNProtocols" => "foo",
256 "HandshakeMode" => "Resume",
257 "ResumptionExpected" => "Yes",
258 "ExpectedNPNProtocol" => "foo",
262 name => "npn-server-switch-resumption",
265 "NPNProtocols" => "bar,foo",
270 "NPNProtocols" => "baz,foo",
275 "NPNProtocols" => "foo,bar,baz",
279 "HandshakeMode" => "Resume",
280 "ResumptionExpected" => "Yes",
281 "ExpectedNPNProtocol" => "baz",
285 name => "npn-client-switch-resumption",
288 "NPNProtocols" => "foo,bar,baz",
293 "NPNProtocols" => "foo,baz",
298 "NPNProtocols" => "bar,baz",
302 "HandshakeMode" => "Resume",
303 "ResumptionExpected" => "Yes",
304 "ExpectedNPNProtocol" => "bar",
308 name => "npn-client-first-pref-on-mismatch-resumption",
311 "NPNProtocols" => "bar",
316 "NPNProtocols" => "baz",
321 "NPNProtocols" => "foo,bar",
325 "HandshakeMode" => "Resume",
326 "ResumptionExpected" => "Yes",
327 "ExpectedNPNProtocol" => "foo",
331 name => "npn-no-server-support-resumption",
334 "NPNProtocols" => "foo",
337 resume_server => { },
340 "NPNProtocols" => "foo",
344 "HandshakeMode" => "Resume",
345 "ResumptionExpected" => "Yes",
346 "ExpectedNPNProtocol" => undef,
350 name => "npn-no-client-support-resumption",
353 "NPNProtocols" => "foo",
358 "NPNProtocols" => "foo",
361 resume_client => { },
363 "HandshakeMode" => "Resume",
364 "ResumptionExpected" => "Yes",
365 "ExpectedNPNProtocol" => undef,
369 name => "alpn-preferred-over-npn-resumption",
372 "NPNProtocols" => "bar",
377 "ALPNProtocols" => "foo",
378 "NPNProtocols" => "baz",
383 "ALPNProtocols" => "foo",
384 "NPNProtocols" => "bar,baz",
388 "HandshakeMode" => "Resume",
389 "ResumptionExpected" => "Yes",
390 "ExpectedALPNProtocol" => "foo",
391 "ExpectedNPNProtocol" => undef,
395 name => "npn-used-if-alpn-not-supported-resumption",
398 "ALPNProtocols" => "foo",
399 "NPNProtocols" => "bar",
404 "NPNProtocols" => "baz",
409 "ALPNProtocols" => "foo",
410 "NPNProtocols" => "bar,baz",
414 "HandshakeMode" => "Resume",
415 "ResumptionExpected" => "Yes",
416 "ExpectedALPNProtocol" => undef,
417 "ExpectedNPNProtocol" => "baz",