()
| 17 | ) |
| 18 | |
| 19 | func ExampleVerifyConnection() { |
| 20 | tr := http.DefaultTransport.(*http.Transport).Clone() |
| 21 | tr.TLSClientConfig = &tls.Config{ |
| 22 | // Set InsecureSkipVerify to skip the default validation we are |
| 23 | // replacing. This will not disable VerifyConnection. |
| 24 | InsecureSkipVerify: true, |
| 25 | VerifyConnection: intermediates.VerifyConnection, |
| 26 | } |
| 27 | |
| 28 | c := &http.Client{Transport: tr, Timeout: 1 * time.Minute} |
| 29 | r, err := c.Get("https://incomplete-chain.badssl.com") |
| 30 | if err != nil { |
| 31 | log.Fatal(err) |
| 32 | } |
| 33 | defer r.Body.Close() |
| 34 | fmt.Println(r.StatusCode) |
| 35 | } |
nothing calls this directly
no outgoing calls
no test coverage detected