LEFT | RIGHT |
1 // Copyright 2010 The Go Authors. All rights reserved. | 1 // Copyright 2010 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 // End-to-end serving tests | 5 // End-to-end serving tests |
6 | 6 |
7 package http_test | 7 package http_test |
8 | 8 |
9 import ( | 9 import ( |
10 "bufio" | 10 "bufio" |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 t.Fatalf("Dial: %v", err) | 579 t.Fatalf("Dial: %v", err) |
580 } | 580 } |
581 defer idleConn.Close() | 581 defer idleConn.Close() |
582 goTimeout(t, 10e9, func() { | 582 goTimeout(t, 10e9, func() { |
583 if !strings.HasPrefix(ts.URL, "https://") { | 583 if !strings.HasPrefix(ts.URL, "https://") { |
584 t.Errorf("expected test TLS server to start with https:/
/, got %q", ts.URL) | 584 t.Errorf("expected test TLS server to start with https:/
/, got %q", ts.URL) |
585 return | 585 return |
586 } | 586 } |
587 noVerifyTransport := &Transport{ | 587 noVerifyTransport := &Transport{ |
588 TLSClientConfig: &tls.Config{ | 588 TLSClientConfig: &tls.Config{ |
589 » » » » SkipVerification: true, | 589 » » » » InsecureSkipVerify: true, |
590 }, | 590 }, |
591 } | 591 } |
592 client := &Client{Transport: noVerifyTransport} | 592 client := &Client{Transport: noVerifyTransport} |
593 res, err := client.Get(ts.URL) | 593 res, err := client.Get(ts.URL) |
594 if err != nil { | 594 if err != nil { |
595 t.Error(err) | 595 t.Error(err) |
596 return | 596 return |
597 } | 597 } |
598 if res == nil { | 598 if res == nil { |
599 t.Errorf("got nil Response") | 599 t.Errorf("got nil Response") |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 panic("ReadAll: " + err.String()) | 1097 panic("ReadAll: " + err.String()) |
1098 } | 1098 } |
1099 body := string(all) | 1099 body := string(all) |
1100 if body != "Hello world.\n" { | 1100 if body != "Hello world.\n" { |
1101 panic("Got body: " + body) | 1101 panic("Got body: " + body) |
1102 } | 1102 } |
1103 } | 1103 } |
1104 | 1104 |
1105 b.StopTimer() | 1105 b.StopTimer() |
1106 } | 1106 } |
LEFT | RIGHT |