LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package tls | 5 package tls |
6 | 6 |
7 import ( | 7 import ( |
8 "big" | 8 "big" |
9 "bytes" | 9 "bytes" |
10 "crypto/rsa" | 10 "crypto/rsa" |
(...skipping 20 matching lines...) Expand all Loading... |
31 var testConfig *Config | 31 var testConfig *Config |
32 | 32 |
33 func init() { | 33 func init() { |
34 testConfig = new(Config) | 34 testConfig = new(Config) |
35 testConfig.Time = func() int64 { return 0 } | 35 testConfig.Time = func() int64 { return 0 } |
36 testConfig.Rand = zeroSource{} | 36 testConfig.Rand = zeroSource{} |
37 testConfig.Certificates = make([]Certificate, 1) | 37 testConfig.Certificates = make([]Certificate, 1) |
38 testConfig.Certificates[0].Certificate = [][]byte{testCertificate} | 38 testConfig.Certificates[0].Certificate = [][]byte{testCertificate} |
39 testConfig.Certificates[0].PrivateKey = testPrivateKey | 39 testConfig.Certificates[0].PrivateKey = testPrivateKey |
40 testConfig.CipherSuites = []uint16{TLS_RSA_WITH_RC4_128_SHA} | 40 testConfig.CipherSuites = []uint16{TLS_RSA_WITH_RC4_128_SHA} |
| 41 testConfig.InsecureSkipVerify = true |
41 } | 42 } |
42 | 43 |
43 func testClientHelloFailure(t *testing.T, m handshakeMessage, expected os.Error)
{ | 44 func testClientHelloFailure(t *testing.T, m handshakeMessage, expected os.Error)
{ |
44 // Create in-memory network connection, | 45 // Create in-memory network connection, |
45 // send message to server. Should return | 46 // send message to server. Should return |
46 // expected error. | 47 // expected error. |
47 c, s := net.Pipe() | 48 c, s := net.Pipe() |
48 go func() { | 49 go func() { |
49 cli := Client(c, testConfig) | 50 cli := Client(c, testConfig) |
50 if ch, ok := m.(*clientHelloMsg); ok { | 51 if ch, ok := m.(*clientHelloMsg); ok { |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 0x03, 0x00, 0x00, 0x21, 0xee, 0x44, 0xf3, 0xa6, | 871 0x03, 0x00, 0x00, 0x21, 0xee, 0x44, 0xf3, 0xa6, |
871 0x88, 0x9d, 0x78, 0x44, 0xde, 0xdf, 0xeb, 0xc5, | 872 0x88, 0x9d, 0x78, 0x44, 0xde, 0xdf, 0xeb, 0xc5, |
872 0xad, 0xc4, 0xcc, 0x56, 0x5c, 0x54, 0x96, 0x52, | 873 0xad, 0xc4, 0xcc, 0x56, 0x5c, 0x54, 0x96, 0x52, |
873 0x3f, 0xd9, 0x40, 0x6e, 0x79, 0xd8, 0x58, 0x78, | 874 0x3f, 0xd9, 0x40, 0x6e, 0x79, 0xd8, 0x58, 0x78, |
874 0x4f, 0x5a, 0xe9, 0x06, 0xef, 0x15, 0x03, 0x00, | 875 0x4f, 0x5a, 0xe9, 0x06, 0xef, 0x15, 0x03, 0x00, |
875 0x00, 0x16, 0xd3, 0xc2, 0x52, 0x99, 0x2a, 0x84, | 876 0x00, 0x16, 0xd3, 0xc2, 0x52, 0x99, 0x2a, 0x84, |
876 0xc4, 0x52, 0x5f, 0x3b, 0x19, 0xe7, 0xfc, 0x65, | 877 0xc4, 0x52, 0x5f, 0x3b, 0x19, 0xe7, 0xfc, 0x65, |
877 0xaf, 0xd3, 0xb7, 0xa3, 0xcc, 0x4a, 0x1d, 0x2e, | 878 0xaf, 0xd3, 0xb7, 0xa3, 0xcc, 0x4a, 0x1d, 0x2e, |
878 }, | 879 }, |
879 } | 880 } |
LEFT | RIGHT |