Skip to content

Commit

Permalink
add proxy environment
Browse files Browse the repository at this point in the history
  • Loading branch information
tbauriedel committed Dec 21, 2023
1 parent 95bc293 commit 677c5c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/icinga2/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ func endpointIsReachable(endpoint string) error {
func collectStatus(endpoint string, c *collection.Collection) error {
c.Log.Debugf("request data from endpoint '%s/v1/status'", endpoint)

// allow insecure connections because of Icinga 2 certificates
// allow insecure connections because of Icinga 2 certificates and add proxy if one is defined in the environments
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, //nolint:gosec
Proxy: http.ProxyFromEnvironment,
}
client := &http.Client{Transport: tr}

Expand Down

0 comments on commit 677c5c1

Please sign in to comment.