Skip to content

Commit 73b6a04

Browse files
committed
Use http.DefaultClient
We should actually do what we're saying we do in the doc. Setting InsecureSkipVerify=true is probably not a good idea to do by default. Fixes: #3
1 parent 3dedcca commit 73b6a04

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

splunk/splunk.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package splunk
22

33
import (
44
"bytes"
5-
"crypto/tls"
65
"encoding/json"
76
"errors"
87
"net/http"
@@ -42,10 +41,9 @@ type Client struct {
4241
// If an httpClient object is specified it will be used instead of the
4342
// default http.DefaultClient.
4443
func NewClient(httpClient *http.Client, URL string, Token string, Source string, SourceType string, Index string) *Client {
45-
// Create a new client
44+
// Use default client
4645
if httpClient == nil {
47-
tr := &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}} // turn off certificate checking
48-
httpClient = &http.Client{Timeout: time.Second * 20, Transport: tr}
46+
httpClient = http.DefaultClient
4947
}
5048
hostname, _ := os.Hostname()
5149
c := &Client{

0 commit comments

Comments
 (0)