2 # Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (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 SNI/Session tickets
20 #Note: MaxProtocol is set to TLSv1.2 as session tickets work differently in
22 sub generate_tests() {
23 foreach my $c ("SessionTicket", "-SessionTicket") {
24 foreach my $s1 ("SessionTicket", "-SessionTicket") {
25 foreach my $s2 ("SessionTicket", "-SessionTicket") {
26 foreach my $n ("server1", "server2") {
27 my $ticket_result = expected_result($c, $s1, $s2, $n);
28 my $session_id_result = "Yes"; # always, even with a ticket
30 "name" => "sni-session-ticket",
36 "MaxProtocol" => "TLSv1.2"
41 # We don't test mismatch here.
42 "ServerNameCallback" => "IgnoreMismatch",
49 "ExpectedServerName" => $n,
50 "ExpectedResult" => "Success",
51 "SessionIdExpected" => $session_id_result,
52 "SessionTicketExpected" => $ticket_result,
61 # If the client has session tickets disabled, then No support
62 # If the server initial_ctx has session tickets disabled, then No support
63 # If SNI is in use, then if the "switched-to" context has session tickets disabled,
66 my ($c, $s1, $s2, $n) = @_;
68 return "No" if $c eq "-SessionTicket";
69 return "No" if $s1 eq "-SessionTicket";
70 return "No" if ($s2 eq "-SessionTicket" && $n eq "server2");
76 # Add a "Broken" case.
78 "name" => "sni-session-ticket",
80 "MaxProtocol" => "TLSv1.2",
81 "Options" => "SessionTicket",
83 "ServerName" => "server1",
87 "Options" => "SessionTicket",
89 "BrokenSessionTicket" => "Yes",
93 "Options" => "SessionTicket",
96 "ExpectedResult" => "Success",
97 "SessionTicketExpected" => "No",