MCPcopy Create free account
hub / github.com/FiloSottile/intermediates / ExampleVerifyConnection

Function ExampleVerifyConnection

example_test.go:19–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17)
18
19func 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected