summaryrefslogtreecommitdiffstats
path: root/api/post.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/post.go
parent8c505e7b5cb8138e53b71ed7e0465665654a596b (diff)
downloadchat-9f5f18a93a6db2b9c1089862fb68c2ee33e634ca.tar.gz
chat-9f5f18a93a6db2b9c1089862fb68c2ee33e634ca.tar.bz2
chat-9f5f18a93a6db2b9c1089862fb68c2ee33e634ca.zip
Make insecure TLS connections configurable
Diffstat (limited to 'api/post.go')
-rw-r--r--api/post.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/api/post.go b/api/post.go
index 58f490558..fadabd66e 100644
--- a/api/post.go
+++ b/api/post.go
@@ -402,9 +402,8 @@ func handleWebhookEventsAndForget(c *Context, post *model.Post, team *model.Team
p.Set("text", post.Message)
p.Set("trigger_word", firstWord)
- // accept any TLS certs
tr := &http.Transport{
- TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
+ TLSClientConfig: &tls.Config{InsecureSkipVerify: *utils.Cfg.ServiceSettings.EnableInsecureOutgoingConnections},
}
client := &http.Client{Transport: tr}
@@ -687,7 +686,10 @@ func sendNotifications(c *Context, post *model.Post, team *model.Team, channel *
msg.Message = senderName + userLocale("api.post.send_notifications_and_forget.push_mention") + channelName
}
- httpClient := http.Client{}
+ tr := &http.Transport{
+ TLSClientConfig: &tls.Config{InsecureSkipVerify: *utils.Cfg.ServiceSettings.EnableInsecureOutgoingConnections},
+ }
+ httpClient := &http.Client{Transport: tr}
request, _ := http.NewRequest("POST", *utils.Cfg.EmailSettings.PushNotificationServer+"/api/v1/send_push", strings.NewReader(msg.ToJson()))
l4g.Debug(utils.T("api.post.send_notifications_and_forget.push_notification.debug"), msg.DeviceId, msg.Message)