Skip to content

Commit 7305bab

Browse files
committed
#41 support https insecure
1 parent 6bf96a7 commit 7305bab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

nginx_vts_exporter.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"crypto/tls"
45
"encoding/json"
56
"flag"
67
"fmt"
@@ -346,6 +347,7 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
346347

347348
func fetchHTTP(uri string, timeout time.Duration) func() (io.ReadCloser, error) {
348349
http.DefaultClient.Timeout = timeout
350+
http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: *insecure}
349351

350352
return func() (io.ReadCloser, error) {
351353
resp, err := http.DefaultClient.Get(uri)

0 commit comments

Comments
 (0)