SSL test framework: port SNI tests
[oweals/openssl.git] / test / ssl-tests / 05-sni.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 ## SSL test configurations
11
12 use strict;
13 use warnings;
14
15 package ssltests;
16
17 our @tests = (
18     {
19         name => "SNI-switch-context",
20         server => { },
21         server2 => { },
22         client => { },
23         test   => { "ServerName" => "server2",
24                     "ExpectedServerName" => "server2",
25                     "ServerNameCallback" => "IgnoreMismatch",
26                     "ExpectedResult" => "Success" },
27     },
28     {
29         name => "SNI-keep-context",
30         server => { },
31         server2 => { },
32         client => { },
33         test   => { "ServerName" => "server1",
34                     "ExpectedServerName" => "server1",
35                     "ServerNameCallback" => "IgnoreMismatch",
36                     "ExpectedResult" => "Success" },
37     },
38     {
39         name => "SNI-no-server-support",
40         server => { },
41         client => { },
42         test   => { "ServerName" => "server1",
43                     "ExpectedResult" => "Success" },
44     },
45     {
46         name => "SNI-no-client-support",
47         server => { },
48         server2 => { },
49         client => { },
50         test   => {
51             # We expect that the callback is still called
52             # to let the application decide whether they tolerate
53             # missing SNI (as our test callback does).
54             "ExpectedServerName" => "server1",
55             "ServerNameCallback" => "IgnoreMismatch",
56             "ExpectedResult" => "Success"
57         },
58     },
59     {
60         name => "SNI-bad-sni-ignore-mismatch",
61         server => { },
62         server2 => { },
63         client => { },
64         test   => { "ServerName" => "invalid",
65                     "ExpectedServerName" => "server1",
66                     "ServerNameCallback" => "IgnoreMismatch",
67                     "ExpectedResult" => "Success" },
68     },
69     {
70         name => "SNI-bad-sni-reject-mismatch",
71         server => { },
72         server2 => { },
73         client => { },
74         test   => { "ServerName" => "invalid",
75                     "ServerNameCallback" => "RejectMismatch",
76                     "ExpectedResult" => "ServerFail",
77                     "ServerAlert" => "UnrecognizedName"},
78     },
79 );