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",
39 "ExpectedServerName" => $n,
40 # We don't test mismatch here.
41 "ServerNameCallback" => "IgnoreMismatch",
42 "ExpectedResult" => "Success",
43 "SessionTicketExpected" => $result,
52 # If the client has session tickets disabled, then No support
53 # If the server initial_ctx has session tickets disabled, then No support
54 # If SNI is in use, then if the "switched-to" context has session tickets disabled,
57 my ($c, $s1, $s2, $n) = @_;
59 return "No" if $c eq "-SessionTicket";
60 return "No" if $s1 eq "-SessionTicket";
61 return "No" if ($s2 eq "-SessionTicket" && $n eq "server2");
67 # Add a "Broken" case.
69 "name" => "sni-session-ticket",
71 "Options" => "SessionTicket",
74 "Options" => "SessionTicket",
77 "Options" => "SessionTicket",
80 "ServerName" => "server1",
81 "ExpectedResult" => "Success",
82 "SessionTicketExpected" => "Broken",