+ "MaxProtocol" => "TLSv1.2"
+ },
+ test => {
+ "ExpectedALPNProtocol" => undef,
+ "ExpectedNPNProtocol" => "bar",
+ "ExpectedServerName" => "server2",
+ },
+ },
+ {
+ name => "npn-simple-resumption",
+ server => {
+ extra => {
+ "NPNProtocols" => "foo",
+ },
+ },
+ client => {
+ extra => {
+ "NPNProtocols" => "foo",
+ },
+ "MaxProtocol" => "TLSv1.2"
+ },
+ 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",
+ },
+ "MaxProtocol" => "TLSv1.2"
+ },
+ test => {
+ "HandshakeMode" => "Resume",
+ "ResumptionExpected" => "Yes",
+ "ExpectedNPNProtocol" => "baz",
+ },
+ },
+ {
+ name => "npn-client-switch-resumption",
+ server => {
+ extra => {
+ "NPNProtocols" => "foo,bar,baz",
+ },
+ },
+ client => {
+ extra => {
+ "NPNProtocols" => "foo,baz",
+ },
+ "MaxProtocol" => "TLSv1.2"
+ },
+ resume_client => {
+ extra => {
+ "NPNProtocols" => "bar,baz",
+ },
+ "MaxProtocol" => "TLSv1.2"
+ },
+ 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",
+ },
+ "MaxProtocol" => "TLSv1.2"
+ },
+ test => {
+ "HandshakeMode" => "Resume",
+ "ResumptionExpected" => "Yes",
+ "ExpectedNPNProtocol" => "foo",
+ },
+ },
+ {
+ name => "npn-no-server-support-resumption",
+ server => {
+ extra => {
+ "NPNProtocols" => "foo",
+ },
+ },
+ resume_server => { },
+ client => {
+ extra => {
+ "NPNProtocols" => "foo",
+ },
+ "MaxProtocol" => "TLSv1.2"
+ },
+ test => {
+ "HandshakeMode" => "Resume",
+ "ResumptionExpected" => "Yes",
+ "ExpectedNPNProtocol" => undef,
+ },
+ },
+ {
+ name => "npn-no-client-support-resumption",
+ server => {
+ extra => {
+ "NPNProtocols" => "foo",
+ },
+ },
+ client => {
+ extra => {
+ "NPNProtocols" => "foo",
+ },
+ "MaxProtocol" => "TLSv1.2"
+ },
+ resume_client => {
+ "MaxProtocol" => "TLSv1.2"
+ },
+ 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",
+ },
+ "MaxProtocol" => "TLSv1.2"
+ },
+ 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",
+ },
+ "MaxProtocol" => "TLSv1.2"