2019-11-24 20:27:59 +00:00
|
|
|
package suites
|
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto/tls"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
2020-05-02 05:06:39 +00:00
|
|
|
// NewHTTPClient create a new client skipping TLS verification and not redirecting.
|
2019-11-24 20:27:59 +00:00
|
|
|
func NewHTTPClient() *http.Client {
|
|
|
|
tr := &http.Transport{
|
|
|
|
TLSClientConfig: &tls.Config{
|
2020-05-05 07:57:30 +00:00
|
|
|
InsecureSkipVerify: true, //nolint:gosec // Needs to be enabled in suites. Not used in production.
|
2019-11-24 20:27:59 +00:00
|
|
|
},
|
|
|
|
}
|
2020-05-05 19:35:32 +00:00
|
|
|
|
2019-11-24 20:27:59 +00:00
|
|
|
return &http.Client{
|
|
|
|
Transport: tr,
|
|
|
|
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
|
|
|
return http.ErrUseLastResponse
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|