aboutsummaryrefslogtreecommitdiff
path: root/matrix/matrix.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-05-23 01:05:56 +0300
committerTulir Asokan <tulir@maunium.net>2018-05-23 01:05:56 +0300
commitf4066e72c3fbd6f246f4e2e1eba280ed02cbbc79 (patch)
tree650d3db34cc72b629430687b2c1e45d6d97ccc6c /matrix/matrix.go
parent1d44d3da1a383121318ac64fe76fb741d3b85375 (diff)
Add environment variable to disable TLS verification
Diffstat (limited to 'matrix/matrix.go')
-rw-r--r--matrix/matrix.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/matrix/matrix.go b/matrix/matrix.go
index 254b212..29766f8 100644
--- a/matrix/matrix.go
+++ b/matrix/matrix.go
@@ -38,6 +38,7 @@ import (
"maunium.net/go/gomuks/lib/bfhtml"
"maunium.net/go/gomuks/matrix/pushrules"
"maunium.net/go/gomuks/matrix/rooms"
+ "crypto/tls"
)
// Container is a wrapper for a gomatrix Client and some other stuff.
@@ -94,6 +95,13 @@ func (c *Container) InitClient() error {
return err
}
+ allowInsecure := len(os.Getenv("GOMUKS_ALLOW_INSECURE_SERVER")) > 0
+ if allowInsecure {
+ c.client.Client = &http.Client{
+ Transport: &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}},
+ }
+ }
+
c.stop = make(chan bool, 1)
if len(accessToken) > 0 {