Skip to content

Instantly share code, notes, and snippets.

@FredericJacobs
Last active August 29, 2015 14:21
Show Gist options
  • Save FredericJacobs/8c99431ea47c409fff67 to your computer and use it in GitHub Desktop.
Save FredericJacobs/8c99431ea47c409fff67 to your computer and use it in GitHub Desktop.
func newHTTPTransporter(baseURL, user, pass string, skipTLSCheck bool) *httpTransporter {
client := &http.Client{}
if skipTLSCheck {
client.Transport = &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
Proxy: http.ProxyFromEnvironment,
}
} else {
client.Transport = &http.Transport{
Proxy: http.ProxyFromEnvironment,
}
}
return &httpTransporter{baseURL, user, pass, client}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment