|
|
|
@ -69,7 +69,7 @@ func connect(options xmpp.Options, directTLS bool) (*xmpp.Client, error) {
|
|
|
|
|
// Use StartTLS
|
|
|
|
|
options.NoTLS = true
|
|
|
|
|
options.StartTLS = true
|
|
|
|
|
options.Host = fmt.Sprintf("%s:%d", adr.host, adr.port)
|
|
|
|
|
options.Host = net.JoinHostPort(adr.host, fmt.Sprint(adr.port))
|
|
|
|
|
// Connect to server
|
|
|
|
|
client, err := options.NewClient()
|
|
|
|
|
if err == nil {
|
|
|
|
@ -79,7 +79,7 @@ func connect(options xmpp.Options, directTLS bool) (*xmpp.Client, error) {
|
|
|
|
|
// Use direct TLS
|
|
|
|
|
options.NoTLS = false
|
|
|
|
|
options.StartTLS = false
|
|
|
|
|
options.Host = fmt.Sprintf("%s:%d", adr.host, adr.port)
|
|
|
|
|
options.Host = net.JoinHostPort(adr.host, fmt.Sprint(adr.port))
|
|
|
|
|
// Connect to server
|
|
|
|
|
client, err := options.NewClient()
|
|
|
|
|
if err == nil {
|
|
|
|
@ -92,7 +92,7 @@ func connect(options xmpp.Options, directTLS bool) (*xmpp.Client, error) {
|
|
|
|
|
// Try port 5222 if no xmpp-client SRV records are provided.
|
|
|
|
|
options.NoTLS = true
|
|
|
|
|
options.StartTLS = true
|
|
|
|
|
options.Host = fmt.Sprintf("%s:%d", server, 5222)
|
|
|
|
|
options.Host = net.JoinHostPort(server, "5222")
|
|
|
|
|
// Connect to server
|
|
|
|
|
client, err := options.NewClient()
|
|
|
|
|
return client, err
|
|
|
|
|