From 9f5f18a93a6db2b9c1089862fb68c2ee33e634ca Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Fri, 5 Feb 2016 12:40:32 -0500 Subject: Make insecure TLS connections configurable --- api/command.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'api/command.go') diff --git a/api/command.go b/api/command.go index a8573cdcc..b22d00dc0 100644 --- a/api/command.go +++ b/api/command.go @@ -4,6 +4,7 @@ package api import ( + "crypto/tls" "fmt" "io/ioutil" "net/http" @@ -172,7 +173,11 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) { method = "GET" } - client := &http.Client{} + tr := &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: *utils.Cfg.ServiceSettings.EnableInsecureOutgoingConnections}, + } + client := &http.Client{Transport: tr} + req, _ := http.NewRequest(method, cmd.URL, strings.NewReader(p.Encode())) req.Header.Set("Accept", "application/json") if cmd.Method == model.COMMAND_METHOD_POST { -- cgit v1.2.3-1-g7c22