From 01a32b21540dd1689b80c4c67c0b686c5ec33dbe Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 14 Jan 2017 00:35:45 +0100 Subject: Handle SkipTLSVerify for XMPP client (#106). Closes #81 * Handle SkipTLSVerify for XMPP client * Mention SkipTLSVerify for XMPP in sample config --- bridge/xmpp/xmpp.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bridge/xmpp') diff --git a/bridge/xmpp/xmpp.go b/bridge/xmpp/xmpp.go index e41baf86..0305975d 100644 --- a/bridge/xmpp/xmpp.go +++ b/bridge/xmpp/xmpp.go @@ -4,6 +4,7 @@ import ( "github.com/42wim/matterbridge/bridge/config" log "github.com/Sirupsen/logrus" "github.com/mattn/go-xmpp" + "crypto/tls" "strings" "time" @@ -58,12 +59,16 @@ func (b *Bxmpp) Send(msg config.Message) error { } func (b *Bxmpp) createXMPP() (*xmpp.Client, error) { + tc := new(tls.Config) + tc.InsecureSkipVerify = b.Config.SkipTLSVerify options := xmpp.Options{ Host: b.Config.Server, User: b.Config.Jid, Password: b.Config.Password, NoTLS: true, StartTLS: true, + TLSConfig: tc, + //StartTLS: false, Debug: true, Session: true, -- cgit v1.2.3