diff options
author | Tulir Asokan <tulir@maunium.net> | 2018-05-23 01:05:56 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2018-05-23 01:05:56 +0300 |
commit | f4066e72c3fbd6f246f4e2e1eba280ed02cbbc79 (patch) | |
tree | 650d3db34cc72b629430687b2c1e45d6d97ccc6c | |
parent | 1d44d3da1a383121318ac64fe76fb741d3b85375 (diff) |
Add environment variable to disable TLS verification
-rw-r--r-- | matrix/matrix.go | 8 |
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 { |