summaryrefslogtreecommitdiffstats
path: root/api/user.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2016-02-05 08:21:15 -0500
committerJoramWilander <jwawilander@gmail.com>2016-02-05 08:21:15 -0500
commit8c505e7b5cb8138e53b71ed7e0465665654a596b (patch)
tree4c89f98fc16cb9b91dd02d8244c0e0076e5a9e60 /api/user.go
parent8e79f12f3c6c0f8858addaf6f66ea6e88a965b65 (diff)
downloadchat-8c505e7b5cb8138e53b71ed7e0465665654a596b.tar.gz
chat-8c505e7b5cb8138e53b71ed7e0465665654a596b.tar.bz2
chat-8c505e7b5cb8138e53b71ed7e0465665654a596b.zip
Accept unsigned TLS certs for SSO and outgoing hooks, also fix delete hooks bug
Diffstat (limited to 'api/user.go')
-rw-r--r--api/user.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/api/user.go b/api/user.go
index 9926f3ff3..aa06fa910 100644
--- a/api/user.go
+++ b/api/user.go
@@ -5,6 +5,7 @@ package api
import (
"bytes"
+ "crypto/tls"
b64 "encoding/base64"
"fmt"
l4g "github.com/alecthomas/log4go"
@@ -1960,7 +1961,11 @@ func AuthorizeOAuthUser(service, code, state, redirectUri string) (io.ReadCloser
p.Set("grant_type", model.ACCESS_TOKEN_GRANT_TYPE)
p.Set("redirect_uri", redirectUri)
- client := &http.Client{}
+ // accept any TLS certs
+ tr := &http.Transport{
+ TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
+ }
+ client := &http.Client{Transport: tr}
req, _ := http.NewRequest("POST", sso.TokenEndpoint, strings.NewReader(p.Encode()))
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")