Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kelseyhightower/0eb7fb9d2be6fd2717cff5c7475c4a3e to your computer and use it in GitHub Desktop.
Save kelseyhightower/0eb7fb9d2be6fd2717cff5c7475c4a3e to your computer and use it in GitHub Desktop.
certPool, err := gocertifi.CACerts()
if err != nil {
log.Fatal(err)
}
c := http.Client{
Timeout: 10 * time.Second,
Transport: &http.Transport{
TLSClientConfig: &tls.Config{RootCAs: certPool},
},
}
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{RootCAs: certPool}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment