Do not verify XMPP certificate.

change-name
Robert Jacob 5 years ago
parent a98639b896
commit f262dc74c2
  1. 15
      xmpp/xmpp.go

@ -1,6 +1,7 @@
package xmpp
import (
"crypto/tls"
"fmt"
"log"
"net"
@ -16,8 +17,20 @@ func AddXMPPListener(storage *spaceapi.Storage, jid, password, target, handle st
return fmt.Errorf("can not find SRV record: %s", err)
}
clientOpts := xmpp.Options{
Host: xmppHost,
User: jid,
Password: password,
NoTLS: true,
Debug: false,
Session: false,
TLSConfig: &tls.Config{
InsecureSkipVerify: true,
},
}
log.Printf("Connecting to %s as %s", xmppHost, jid)
client, err := xmpp.NewClientNoTLS(xmppHost, jid, password, false)
client, err := clientOpts.NewClient()
if err != nil {
return fmt.Errorf("can not connect to server: %s", err)
}

Loading…
Cancel
Save