From f4066e72c3fbd6f246f4e2e1eba280ed02cbbc79 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 23 May 2018 01:05:56 +0300 Subject: Add environment variable to disable TLS verification --- matrix/matrix.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'matrix') 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 { -- cgit v1.2.3