summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmpp.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/xmpp.go b/xmpp.go
index 8078c1a..abc098d 100644
--- a/xmpp.go
+++ b/xmpp.go
@@ -2,7 +2,8 @@ package main
import (
"log"
- "net"
+ "crypto/tls"
+ "crypto/x509"
)
type XmppEvent uint8
@@ -18,14 +19,13 @@ func (l *Limox) xmpp(jid string, pwd string) {
domain := domainpart(jid)
log.Printf("Domain: '%s'\n", domain)
- tcpServer, err := net.ResolveTCPAddr("tcp", domain+":"+"5222")
+ roots, err := x509.SystemCertPool()
if err != nil {
l.XmppEvents <- err
return
}
- log.Printf("Server: %s\n", tcpServer)
- conn, err := net.DialTCP("tcp", nil, tcpServer)
+ conn, err := tls.Dial("tcp", domain+":"+"5223", &tls.Config{RootCAs: roots})
if err != nil {
l.XmppEvents <- err
return