Fixed TLS errors in collect

This commit is contained in:
David J. Allen 2024-05-08 14:46:29 -06:00
parent 0403b2bcbc
commit a75530e96b
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC
2 changed files with 9 additions and 7 deletions

View file

@ -529,7 +529,7 @@ func makeGofishConfig(q *QueryParams) (gofish.ClientConfig, error) {
Endpoint: url, Endpoint: url,
Username: q.User, Username: q.User,
Password: q.Pass, Password: q.Pass,
Insecure: q.CaCertPath == "", Insecure: true,
TLSHandshakeTimeout: q.Timeout, TLSHandshakeTimeout: q.Timeout,
HTTPClient: client, HTTPClient: client,
// MaxConcurrentRequests: int64(q.Threads), // NOTE: this was added in latest version of gofish // MaxConcurrentRequests: int64(q.Threads), // NOTE: this was added in latest version of gofish

View file

@ -45,7 +45,9 @@ func MakeRequest(client *http.Client, url string, httpMethod string, body []byte
// use defaults if no client provided // use defaults if no client provided
if client == nil { if client == nil {
client = http.DefaultClient client = http.DefaultClient
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true} client.Transport = &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
} }
req, err := http.NewRequest(httpMethod, url, bytes.NewBuffer(body)) req, err := http.NewRequest(httpMethod, url, bytes.NewBuffer(body))
if err != nil { if err != nil {