9b0dcba9993d59539235d36fae18ca36c2a973ad
[openssl.git] / test / ssl-tests / 08-npn.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 => "npn-simple",
21         server => { },
22         client => { },
23         test => {
24              "ClientNPNProtocols" => "foo",
25              "ServerNPNProtocols" => "foo",
26              "ExpectedNPNProtocol" => "foo",
27         },
28     },
29     {
30         name => "npn-client-finds-match",
31         server => { },
32         client => { },
33         test => {
34              "ClientNPNProtocols" => "foo,bar",
35              "ServerNPNProtocols" => "baz,bar",
36              "ExpectedNPNProtocol" => "bar",
37         },
38     },
39     {
40         name => "npn-client-honours-server-pref",
41         server => { },
42         client => { },
43         test => {
44              "ClientNPNProtocols" => "foo,bar",
45              "ServerNPNProtocols" => "bar,foo",
46              "ExpectedNPNProtocol" => "bar",
47         },
48     },
49     {
50         name => "npn-client-first-pref-on-mismatch",
51         server => { },
52         client => { },
53         test => {
54              "ClientNPNProtocols" => "foo,bar",
55              "ServerNPNProtocols" => "baz",
56              "ExpectedNPNProtocol" => "foo",
57         },
58     },
59     {
60         name => "npn-no-server-support",
61         server => { },
62         client => { },
63         test => {
64              "ClientNPNProtocols" => "foo",
65              "ExpectedNPNProtocol" => undef,
66         },
67     },
68     {
69         name => "npn-no-client-support",
70         server => { },
71         client => { },
72         test => {
73              "ServerNPNProtocols" => "foo",
74              "ExpectedNPNProtocol" => undef,
75         },
76     },
77     {
78         name => "npn-with-sni-no-context-switch",
79         server => { },
80         server2 => { },
81         client => { },
82         test => {
83              "ClientNPNProtocols" => "foo,bar",
84              "ServerNPNProtocols" => "foo",
85              "Server2NPNProtocols" => "bar",
86              "ServerName" => "server1",
87              "ServerNameCallback" => "IgnoreMismatch",
88              "ExpectedServerName" => "server1",
89              "ExpectedNPNProtocol" => "foo",
90         },
91     },
92     {
93         name => "npn-with-sni-context-switch",
94         server => { },
95         server2 => { },
96         client => { },
97         test => {
98              "ClientNPNProtocols" => "foo,bar",
99              "ServerNPNProtocols" => "foo",
100              "Server2NPNProtocols" => "bar",
101              "ServerName" => "server2",
102              "ServerNameCallback" => "IgnoreMismatch",
103              "ExpectedServerName" => "server2",
104              "ExpectedNPNProtocol" => "bar",
105         },
106     },
107     {
108         name => "npn-selected-sni-server-supports-npn",
109         server => { },
110         server2 => { },
111         client => { },
112         test => {
113              "ClientNPNProtocols" => "foo,bar",
114              "Server2NPNProtocols" => "bar",
115              "ServerName" => "server2",
116              "ServerNameCallback" => "IgnoreMismatch",
117              "ExpectedServerName" => "server2",
118              "ExpectedNPNProtocol" => "bar",
119         },
120     },
121     {
122         name => "npn-selected-sni-server-does-not-support-npn",
123         server => { },
124         server2 => { },
125         client => { },
126         test => {
127              "ClientNPNProtocols" => "foo,bar",
128              "ServerNPNProtocols" => "foo",
129              "ServerName" => "server2",
130              "ServerNameCallback" => "IgnoreMismatch",
131              "ExpectedServerName" => "server2",
132              "ExpectedNPNProtocol" => undef,
133         },
134     },
135     {
136         name => "alpn-preferred-over-npn",
137         server => { },
138         client => { },
139         test => {
140              "ClientALPNProtocols" => "foo",
141              "ClientNPNProtocols" => "bar",
142              "ServerALPNProtocols" => "foo",
143              "ServerNPNProtocols" => "bar",
144              "ExpectedALPNProtocol" => "foo",
145              "ExpectedNPNProtocol" => undef,
146         },
147     },
148     {
149         name => "sni-npn-preferred-over-alpn",
150         server => { },
151         server2 => { },
152         client => { },
153         test => {
154              "ClientALPNProtocols" => "foo",
155              "ClientNPNProtocols" => "bar",
156              "ServerALPNProtocols" => "foo",
157              "Server2NPNProtocols" => "bar",
158              "ServerName" => "server2",
159              "ServerNameCallback" => "IgnoreMismatch",
160              "ExpectedServerName" => "server2",
161              "ExpectedALPNProtocol" => undef,
162              "ExpectedNPNProtocol" => "bar",
163         },
164     },
165 );