2a7b1f97c2ce4d7a0c790864293ab77f844f8ec7
[openssl.git] / test / ssl-tests / 09-alpn.conf.in
1 # -*- mode: perl; -*-
2 # Copyright 2016-2016 The OpenSSL Project Authors. All Rights Reserved.
3 #
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
8
9
10 ## Test version negotiation
11
12 use strict;
13 use warnings;
14
15 package ssltests;
16
17
18 our @tests = (
19     {
20         name => "alpn-simple",
21         server => { },
22         client => { },
23         test => {
24              "ClientALPNProtocols" => "foo",
25              "ServerALPNProtocols" => "foo",
26              "ExpectedALPNProtocol" => "foo",
27         },
28     },
29     {
30         name => "alpn-client-finds-match",
31         server => { },
32         client => { },
33         test => {
34              "ClientALPNProtocols" => "foo,bar",
35              "ServerALPNProtocols" => "baz,bar",
36              "ExpectedALPNProtocol" => "bar",
37         },
38     },
39     {
40         name => "alpn-client-honours-server-pref",
41         server => { },
42         client => { },
43         test => {
44              "ClientALPNProtocols" => "foo,bar",
45              "ServerALPNProtocols" => "bar,foo",
46              "ExpectedALPNProtocol" => "bar",
47         },
48     },
49     {
50         name => "alpn-alert-on-mismatch",
51         server => { },
52         client => { },
53         test => {
54              "ClientALPNProtocols" => "foo,bar",
55              "ServerALPNProtocols" => "baz",
56              "ExpectedResult" => "ServerFail",
57              "ServerAlert" => "NoApplicationProtocol",
58         },
59     },
60     {
61         name => "alpn-no-server-support",
62         server => { },
63         client => { },
64         test => {
65              "ClientALPNProtocols" => "foo",
66              "ExpectedALPNProtocol" => undef,
67         },
68     },
69     {
70         name => "alpn-no-client-support",
71         server => { },
72         client => { },
73         test => {
74              "ServerALPNProtocols" => "foo",
75              "ExpectedALPNProtocol" => undef,
76         },
77     },
78     {
79         name => "alpn-with-sni-no-context-switch",
80         server => { },
81         server2 => { },
82         client => { },
83         test => {
84              "ClientALPNProtocols" => "foo,bar",
85              "ServerALPNProtocols" => "foo",
86              "Server2ALPNProtocols" => "bar",
87              "ServerName" => "server1",
88              "ServerNameCallback" => "IgnoreMismatch",
89              "ExpectedServerName" => "server1",
90              "ExpectedALPNProtocol" => "foo",
91         },
92     },
93     {
94         name => "alpn-with-sni-context-switch",
95         server => { },
96         server2 => { },
97         client => { },
98         test => {
99              "ClientALPNProtocols" => "foo,bar",
100              "ServerALPNProtocols" => "foo",
101              "Server2ALPNProtocols" => "bar",
102              "ServerName" => "server2",
103              "ServerNameCallback" => "IgnoreMismatch",
104              "ExpectedServerName" => "server2",
105              "ExpectedALPNProtocol" => "bar",
106         },
107     },
108     {
109         name => "alpn-selected-sni-server-supports-alpn",
110         server => { },
111         server2 => { },
112         client => { },
113         test => {
114              "ClientALPNProtocols" => "foo,bar",
115              "Server2ALPNProtocols" => "bar",
116              "ServerName" => "server2",
117              "ServerNameCallback" => "IgnoreMismatch",
118              "ExpectedServerName" => "server2",
119              "ExpectedALPNProtocol" => "bar",
120         },
121     },
122     {
123         name => "alpn-selected-sni-server-does-not-support-alpn",
124         server => { },
125         server2 => { },
126         client => { },
127         test => {
128              "ClientALPNProtocols" => "foo,bar",
129              "ServerALPNProtocols" => "foo",
130              "ServerName" => "server2",
131              "ServerNameCallback" => "IgnoreMismatch",
132              "ExpectedServerName" => "server2",
133              "ExpectedALPNProtocol" => undef,
134         },
135     },
136 );