5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 17:30:26 +00:00

Fix tls by setting ServerName (xmpp) (#114)

Fixes error message shown by tls: "either ServerName or InsecureSkipVerify must be specified in the tls.Config"
This commit is contained in:
Josip Janžić 2017-01-18 21:01:42 +01:00 committed by Wim
parent 884599d27d
commit 9bf10e4b58

View File

@ -61,6 +61,7 @@ func (b *Bxmpp) Send(msg config.Message) error {
func (b *Bxmpp) createXMPP() (*xmpp.Client, error) { func (b *Bxmpp) createXMPP() (*xmpp.Client, error) {
tc := new(tls.Config) tc := new(tls.Config)
tc.InsecureSkipVerify = b.Config.SkipTLSVerify tc.InsecureSkipVerify = b.Config.SkipTLSVerify
tc.ServerName = strings.Split(b.Config.Server, ":")[0]
options := xmpp.Options{ options := xmpp.Options{
Host: b.Config.Server, Host: b.Config.Server,
User: b.Config.Jid, User: b.Config.Jid,