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 NPN. Note that NPN is only supported up to TLSv1.2
22 "NPNProtocols" => "foo",
27 "NPNProtocols" => "foo",
29 "MaxProtocol" => "TLSv1.2"
32 "ExpectedNPNProtocol" => "foo",
36 name => "npn-client-finds-match",
39 "NPNProtocols" => "baz,bar",
44 "NPNProtocols" => "foo,bar",
46 "MaxProtocol" => "TLSv1.2"
49 "ExpectedNPNProtocol" => "bar",
53 name => "npn-client-honours-server-pref",
56 "NPNProtocols" => "bar,foo",
61 "NPNProtocols" => "foo,bar",
63 "MaxProtocol" => "TLSv1.2"
66 "ExpectedNPNProtocol" => "bar",
70 name => "npn-client-first-pref-on-mismatch",
73 "NPNProtocols" => "baz",
78 "NPNProtocols" => "foo,bar",
80 "MaxProtocol" => "TLSv1.2"
83 "ExpectedNPNProtocol" => "foo",
87 name => "npn-no-server-support",
91 "NPNProtocols" => "foo",
93 "MaxProtocol" => "TLSv1.2"
96 "ExpectedNPNProtocol" => undef,
100 name => "npn-no-client-support",
103 "NPNProtocols" => "foo",
107 "MaxProtocol" => "TLSv1.2"
110 "ExpectedNPNProtocol" => undef,
114 name => "npn-with-sni-no-context-switch",
117 "NPNProtocols" => "foo",
118 "ServerNameCallback" => "IgnoreMismatch",
123 "NPNProtocols" => "bar",
128 "NPNProtocols" => "foo,bar",
129 "ServerName" => "server1",
131 "MaxProtocol" => "TLSv1.2"
134 "ExpectedServerName" => "server1",
135 "ExpectedNPNProtocol" => "foo",
139 name => "npn-with-sni-context-switch",
142 "NPNProtocols" => "foo",
143 "ServerNameCallback" => "IgnoreMismatch",
148 "NPNProtocols" => "bar",
153 "NPNProtocols" => "foo,bar",
154 "ServerName" => "server2",
156 "MaxProtocol" => "TLSv1.2"
159 "ExpectedServerName" => "server2",
160 "ExpectedNPNProtocol" => "bar",
164 name => "npn-selected-sni-server-supports-npn",
167 "ServerNameCallback" => "IgnoreMismatch",
172 "NPNProtocols" => "bar",
177 "NPNProtocols" => "foo,bar",
178 "ServerName" => "server2",
180 "MaxProtocol" => "TLSv1.2"
183 "ExpectedServerName" => "server2",
184 "ExpectedNPNProtocol" => "bar",
188 name => "npn-selected-sni-server-does-not-support-npn",
191 "NPNProtocols" => "bar",
192 "ServerNameCallback" => "IgnoreMismatch",
198 "NPNProtocols" => "foo,bar",
199 "ServerName" => "server2",
201 "MaxProtocol" => "TLSv1.2"
204 "ExpectedServerName" => "server2",
205 "ExpectedNPNProtocol" => undef,
209 name => "alpn-preferred-over-npn",
212 "ALPNProtocols" => "foo",
213 "NPNProtocols" => "bar",
218 "ALPNProtocols" => "foo",
219 "NPNProtocols" => "bar",
221 "MaxProtocol" => "TLSv1.2"
224 "ExpectedALPNProtocol" => "foo",
225 "ExpectedNPNProtocol" => undef,
229 name => "sni-npn-preferred-over-alpn",
232 "ServerNameCallback" => "IgnoreMismatch",
233 "ALPNProtocols" => "foo",
238 "NPNProtocols" => "bar",
243 "ServerName" => "server2",
244 "ALPNProtocols" => "foo",
245 "NPNProtocols" => "bar",
247 "MaxProtocol" => "TLSv1.2"
250 "ExpectedALPNProtocol" => undef,
251 "ExpectedNPNProtocol" => "bar",
252 "ExpectedServerName" => "server2",
256 name => "npn-simple-resumption",
259 "NPNProtocols" => "foo",
264 "NPNProtocols" => "foo",
266 "MaxProtocol" => "TLSv1.2"
269 "HandshakeMode" => "Resume",
270 "ResumptionExpected" => "Yes",
271 "ExpectedNPNProtocol" => "foo",
275 name => "npn-server-switch-resumption",
278 "NPNProtocols" => "bar,foo",
283 "NPNProtocols" => "baz,foo",
288 "NPNProtocols" => "foo,bar,baz",
290 "MaxProtocol" => "TLSv1.2"
293 "HandshakeMode" => "Resume",
294 "ResumptionExpected" => "Yes",
295 "ExpectedNPNProtocol" => "baz",
299 name => "npn-client-switch-resumption",
302 "NPNProtocols" => "foo,bar,baz",
307 "NPNProtocols" => "foo,baz",
309 "MaxProtocol" => "TLSv1.2"
313 "NPNProtocols" => "bar,baz",
315 "MaxProtocol" => "TLSv1.2"
318 "HandshakeMode" => "Resume",
319 "ResumptionExpected" => "Yes",
320 "ExpectedNPNProtocol" => "bar",
324 name => "npn-client-first-pref-on-mismatch-resumption",
327 "NPNProtocols" => "bar",
332 "NPNProtocols" => "baz",
337 "NPNProtocols" => "foo,bar",
339 "MaxProtocol" => "TLSv1.2"
342 "HandshakeMode" => "Resume",
343 "ResumptionExpected" => "Yes",
344 "ExpectedNPNProtocol" => "foo",
348 name => "npn-no-server-support-resumption",
351 "NPNProtocols" => "foo",
354 resume_server => { },
357 "NPNProtocols" => "foo",
359 "MaxProtocol" => "TLSv1.2"
362 "HandshakeMode" => "Resume",
363 "ResumptionExpected" => "Yes",
364 "ExpectedNPNProtocol" => undef,
368 name => "npn-no-client-support-resumption",
371 "NPNProtocols" => "foo",
376 "NPNProtocols" => "foo",
378 "MaxProtocol" => "TLSv1.2"
381 "MaxProtocol" => "TLSv1.2"
384 "HandshakeMode" => "Resume",
385 "ResumptionExpected" => "Yes",
386 "ExpectedNPNProtocol" => undef,
390 name => "alpn-preferred-over-npn-resumption",
393 "NPNProtocols" => "bar",
398 "ALPNProtocols" => "foo",
399 "NPNProtocols" => "baz",
404 "ALPNProtocols" => "foo",
405 "NPNProtocols" => "bar,baz",
407 "MaxProtocol" => "TLSv1.2"
410 "HandshakeMode" => "Resume",
411 "ResumptionExpected" => "Yes",
412 "ExpectedALPNProtocol" => "foo",
413 "ExpectedNPNProtocol" => undef,
417 name => "npn-used-if-alpn-not-supported-resumption",
420 "ALPNProtocols" => "foo",
421 "NPNProtocols" => "bar",
426 "NPNProtocols" => "baz",
431 "ALPNProtocols" => "foo",
432 "NPNProtocols" => "bar,baz",
434 "MaxProtocol" => "TLSv1.2"
437 "HandshakeMode" => "Resume",
438 "ResumptionExpected" => "Yes",
439 "ExpectedALPNProtocol" => undef,
440 "ExpectedNPNProtocol" => "baz",