mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-27 21:22:03 -08:00
* Handle SkipTLSVerify for XMPP client * Mention SkipTLSVerify for XMPP in sample config
This commit is contained in:
parent
b3c3142bb2
commit
01a32b2154
@ -4,6 +4,7 @@ import (
|
|||||||
"github.com/42wim/matterbridge/bridge/config"
|
"github.com/42wim/matterbridge/bridge/config"
|
||||||
log "github.com/Sirupsen/logrus"
|
log "github.com/Sirupsen/logrus"
|
||||||
"github.com/mattn/go-xmpp"
|
"github.com/mattn/go-xmpp"
|
||||||
|
"crypto/tls"
|
||||||
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -58,12 +59,16 @@ 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.InsecureSkipVerify = b.Config.SkipTLSVerify
|
||||||
options := xmpp.Options{
|
options := xmpp.Options{
|
||||||
Host: b.Config.Server,
|
Host: b.Config.Server,
|
||||||
User: b.Config.Jid,
|
User: b.Config.Jid,
|
||||||
Password: b.Config.Password,
|
Password: b.Config.Password,
|
||||||
NoTLS: true,
|
NoTLS: true,
|
||||||
StartTLS: true,
|
StartTLS: true,
|
||||||
|
TLSConfig: tc,
|
||||||
|
|
||||||
//StartTLS: false,
|
//StartTLS: false,
|
||||||
Debug: true,
|
Debug: true,
|
||||||
Session: true,
|
Session: true,
|
||||||
|
@ -97,6 +97,11 @@ Muc="conference.jabber.example.com"
|
|||||||
#REQUIRED
|
#REQUIRED
|
||||||
Nick="xmppbot"
|
Nick="xmppbot"
|
||||||
|
|
||||||
|
#Enable to not verify the certificate on your xmpp server.
|
||||||
|
#e.g. when using selfsigned certificates
|
||||||
|
#OPTIONAL (default false)
|
||||||
|
SkipTLSVerify=true
|
||||||
|
|
||||||
#Nicks you want to ignore.
|
#Nicks you want to ignore.
|
||||||
#Messages from those users will not be sent to other bridges.
|
#Messages from those users will not be sent to other bridges.
|
||||||
#OPTIONAL
|
#OPTIONAL
|
||||||
|
Loading…
Reference in New Issue
Block a user