Skip to content

Commit

Permalink
#41 support https insecure
Browse files Browse the repository at this point in the history
  • Loading branch information
sysulq committed Feb 25, 2018
1 parent 6bf96a7 commit 7305bab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nginx_vts_exporter.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"crypto/tls"
"encoding/json"
"flag"
"fmt"
Expand Down Expand Up @@ -346,6 +347,7 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {

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

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

0 comments on commit 7305bab

Please sign in to comment.