| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  | # -*- mode: perl; -*- | 
					
						
							| 
									
										
										
										
											2020-04-23 20:55:52 +08:00
										 |  |  | # Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2018-12-06 20:05:25 +08:00
										 |  |  | # Licensed under the Apache License 2.0 (the "License").  You may not use | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  | # this file except in compliance with the License.  You can obtain a copy | 
					
						
							|  |  |  | # in the file LICENSE in the source distribution or at | 
					
						
							|  |  |  | # https://www.openssl.org/source/license.html | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  | ## Test NPN. Note that NPN is only supported up to TLSv1.2 | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | use strict; | 
					
						
							|  |  |  | use warnings; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | package ssltests; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | our @tests = ( | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-simple", | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         test => { | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |             "ExpectedNPNProtocol" => "foo", | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-client-finds-match", | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "baz,bar", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo,bar", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         test => { | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |             "ExpectedNPNProtocol" => "bar", | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-client-honours-server-pref", | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar,foo", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo,bar", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         test => { | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |             "ExpectedNPNProtocol" => "bar", | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-client-first-pref-on-mismatch", | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "baz", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo,bar", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         test => { | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |             "ExpectedNPNProtocol" => "foo", | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-no-server-support", | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |         server => {}, | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         test => { | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |             "ExpectedNPNProtocol" => undef, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-no-client-support", | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |         client => { | 
					
						
							|  |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         test => { | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |             "ExpectedNPNProtocol" => undef, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-with-sni-no-context-switch", | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo", | 
					
						
							|  |  |  |                 "ServerNameCallback" => "IgnoreMismatch", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         server2 => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo,bar", | 
					
						
							|  |  |  |                 "ServerName" => "server1", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         test => { | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |             "ExpectedServerName" => "server1", | 
					
						
							|  |  |  |             "ExpectedNPNProtocol" => "foo", | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-with-sni-context-switch", | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo", | 
					
						
							|  |  |  |                 "ServerNameCallback" => "IgnoreMismatch", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         server2 => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo,bar", | 
					
						
							|  |  |  |                 "ServerName" => "server2", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         test => { | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |             "ExpectedServerName" => "server2", | 
					
						
							|  |  |  |             "ExpectedNPNProtocol" => "bar", | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-selected-sni-server-supports-npn", | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "ServerNameCallback" => "IgnoreMismatch", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         server2 => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo,bar", | 
					
						
							|  |  |  |                 "ServerName" => "server2", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         test => { | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |             "ExpectedServerName" => "server2", | 
					
						
							|  |  |  |             "ExpectedNPNProtocol" => "bar", | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-selected-sni-server-does-not-support-npn", | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar", | 
					
						
							|  |  |  |                 "ServerNameCallback" => "IgnoreMismatch", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         server2 => { }, | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo,bar", | 
					
						
							|  |  |  |                 "ServerName" => "server2", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         test => { | 
					
						
							|  |  |  |              "ExpectedServerName" => "server2", | 
					
						
							|  |  |  |              "ExpectedNPNProtocol" => undef, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "alpn-preferred-over-npn", | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "ALPNProtocols" => "foo", | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "ALPNProtocols" => "foo", | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         test => { | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |             "ExpectedALPNProtocol" => "foo", | 
					
						
							|  |  |  |             "ExpectedNPNProtocol" => undef, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "sni-npn-preferred-over-alpn", | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "ServerNameCallback" => "IgnoreMismatch", | 
					
						
							|  |  |  |                 "ALPNProtocols" => "foo", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         server2 => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "ServerName" => "server2", | 
					
						
							|  |  |  |                 "ALPNProtocols" => "foo", | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-07-21 22:29:48 +08:00
										 |  |  |         }, | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         test => { | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |             "ExpectedALPNProtocol" => undef, | 
					
						
							|  |  |  |             "ExpectedNPNProtocol" => "bar", | 
					
						
							|  |  |  |             "ExpectedServerName" => "server2",   | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-simple-resumption", | 
					
						
							|  |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |         test => { | 
					
						
							|  |  |  |             "HandshakeMode" => "Resume", | 
					
						
							|  |  |  |             "ResumptionExpected" => "Yes", | 
					
						
							|  |  |  |             "ExpectedNPNProtocol" => "foo", | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-server-switch-resumption", | 
					
						
							|  |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar,foo", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         resume_server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "baz,foo", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo,bar,baz", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |         test => { | 
					
						
							|  |  |  |             "HandshakeMode" => "Resume", | 
					
						
							|  |  |  |             "ResumptionExpected" => "Yes", | 
					
						
							|  |  |  |             "ExpectedNPNProtocol" => "baz", | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-client-switch-resumption", | 
					
						
							|  |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo,bar,baz", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo,baz", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |         resume_client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar,baz", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |         test => { | 
					
						
							|  |  |  |             "HandshakeMode" => "Resume", | 
					
						
							|  |  |  |             "ResumptionExpected" => "Yes", | 
					
						
							|  |  |  |             "ExpectedNPNProtocol" => "bar", | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-client-first-pref-on-mismatch-resumption", | 
					
						
							|  |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         resume_server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "baz", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo,bar", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |         test => { | 
					
						
							|  |  |  |             "HandshakeMode" => "Resume", | 
					
						
							|  |  |  |             "ResumptionExpected" => "Yes", | 
					
						
							|  |  |  |             "ExpectedNPNProtocol" => "foo", | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-no-server-support-resumption", | 
					
						
							|  |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         resume_server => { }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |         test => { | 
					
						
							|  |  |  |             "HandshakeMode" => "Resume", | 
					
						
							|  |  |  |             "ResumptionExpected" => "Yes", | 
					
						
							|  |  |  |             "ExpectedNPNProtocol" => undef, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-no-client-support-resumption", | 
					
						
							|  |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "foo", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         resume_client => { | 
					
						
							|  |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |         test => { | 
					
						
							|  |  |  |             "HandshakeMode" => "Resume", | 
					
						
							|  |  |  |             "ResumptionExpected" => "Yes", | 
					
						
							|  |  |  |             "ExpectedNPNProtocol" => undef, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "alpn-preferred-over-npn-resumption", | 
					
						
							|  |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         resume_server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "ALPNProtocols" => "foo", | 
					
						
							|  |  |  |                 "NPNProtocols" => "baz", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "ALPNProtocols" => "foo", | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar,baz", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |         test => { | 
					
						
							|  |  |  |             "HandshakeMode" => "Resume", | 
					
						
							|  |  |  |             "ResumptionExpected" => "Yes", | 
					
						
							|  |  |  |             "ExpectedALPNProtocol" => "foo", | 
					
						
							|  |  |  |             "ExpectedNPNProtocol" => undef, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         name => "npn-used-if-alpn-not-supported-resumption", | 
					
						
							|  |  |  |         server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "ALPNProtocols" => "foo", | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         resume_server => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "NPNProtocols" => "baz", | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         client => { | 
					
						
							|  |  |  |             extra => { | 
					
						
							|  |  |  |                 "ALPNProtocols" => "foo", | 
					
						
							|  |  |  |                 "NPNProtocols" => "bar,baz", | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2016-11-02 23:03:56 +08:00
										 |  |  |             "MaxProtocol" => "TLSv1.2" | 
					
						
							| 
									
										
										
										
											2016-08-08 20:42:08 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |         test => { | 
					
						
							|  |  |  |             "HandshakeMode" => "Resume", | 
					
						
							|  |  |  |             "ResumptionExpected" => "Yes", | 
					
						
							|  |  |  |             "ExpectedALPNProtocol" => undef, | 
					
						
							|  |  |  |             "ExpectedNPNProtocol" => "baz", | 
					
						
							| 
									
										
										
										
											2016-07-05 02:16:14 +08:00
										 |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  | ); |