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 version negotiation
20 sub generate_tests() {
21 foreach my $c ("SessionTicket", "-SessionTicket") {
22 foreach my $s1 ("SessionTicket", "-SessionTicket") {
23 foreach my $s2 ("SessionTicket", "-SessionTicket") {
24 foreach my $n ("server1", "server2") {
25 my $result = expected_result($c, $s1, $s2, $n);
27 "name" => "sni-session-ticket",
37 # We don't test mismatch here.
38 "ServerNameCallback" => "IgnoreMismatch",
45 "ExpectedServerName" => $n,
46 "ExpectedResult" => "Success",
47 "SessionTicketExpected" => $result,
56 # If the client has session tickets disabled, then No support
57 # If the server initial_ctx has session tickets disabled, then No support
58 # If SNI is in use, then if the "switched-to" context has session tickets disabled,
61 my ($c, $s1, $s2, $n) = @_;
63 return "No" if $c eq "-SessionTicket";
64 return "No" if $s1 eq "-SessionTicket";
65 return "No" if ($s2 eq "-SessionTicket" && $n eq "server2");
71 # Add a "Broken" case.
73 "name" => "sni-session-ticket",
75 "Options" => "SessionTicket",
77 "ServerName" => "server1",
81 "Options" => "SessionTicket",
83 "BrokenSessionTicket" => "Yes",
87 "Options" => "SessionTicket",
90 "ExpectedResult" => "Success",
91 "SessionTicketExpected" => "No",