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