Make insecure TLS connections configurable

Этот коммит содержится в:
JoramWilander
2016-02-05 12:40:32 -05:00
родитель 8c505e7b5c
Коммит 9f5f18a93a
9 изменённых файлов: 95 добавлений и 30 удалений

Просмотреть файл

@@ -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 {