summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick <nick@kousu.ca>2019-06-13 19:10:43 -0400
committerWim <wim@42.be>2019-06-14 01:10:43 +0200
commit7a3bb0e55cd7c11807d23024a66faec40d39e20a (patch)
treef033f77887061d4b0cc1b6470daddc9628431808
parent6e8f535e8b60697606dbec78340a955642c7f0a4 (diff)
downloadmatterbridge-msglm-7a3bb0e55cd7c11807d23024a66faec40d39e20a.tar.gz
matterbridge-msglm-7a3bb0e55cd7c11807d23024a66faec40d39e20a.tar.bz2
matterbridge-msglm-7a3bb0e55cd7c11807d23024a66faec40d39e20a.zip
Verify TLS against JID domain, not the host. (xmpp) (#834)
Partially fixes #820. A full fix requires patching https://github.com/matterbridge/go-xmpp to use DNS SRV records.
-rw-r--r--bridge/xmpp/xmpp.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/bridge/xmpp/xmpp.go b/bridge/xmpp/xmpp.go
index 8257b7de..2376d60c 100644
--- a/bridge/xmpp/xmpp.go
+++ b/bridge/xmpp/xmpp.go
@@ -100,7 +100,7 @@ func (b *Bxmpp) Send(msg config.Message) (string, error) {
func (b *Bxmpp) createXMPP() error {
tc := &tls.Config{
- ServerName: strings.Split(b.GetString("Server"), ":")[0],
+ ServerName: strings.Split(b.GetString("Jid"), "@")[1],
InsecureSkipVerify: b.GetBool("SkipTLSVerify"), // nolint: gosec
}
options := xmpp.Options{