summaryrefslogtreecommitdiffstats
path: root/api/command.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-02-05 12:40:32 -0500
committerJoramWilander <jwawilander@gmail.com>2016-02-05 12:40:32 -0500
commit9f5f18a93a6db2b9c1089862fb68c2ee33e634ca (patch)
tree67f66a9bcfda2ad1d87ae238b47f8be6531522b2 /api/command.go
parent8c505e7b5cb8138e53b71ed7e0465665654a596b (diff)
downloadchat-9f5f18a93a6db2b9c1089862fb68c2ee33e634ca.tar.gz
chat-9f5f18a93a6db2b9c1089862fb68c2ee33e634ca.tar.bz2
chat-9f5f18a93a6db2b9c1089862fb68c2ee33e634ca.zip
Make insecure TLS connections configurable
Diffstat (limited to 'api/command.go')
-rw-r--r--api/command.go7
1 files changed, 6 insertions, 1 deletions
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 {