Removed tls

This commit is contained in:
Senad Uka
2021-09-22 16:33:01 +02:00
parent 58f003ec99
commit 7e3650352e
3 changed files with 207 additions and 5 deletions

View File

@@ -1,7 +1,6 @@
package services
import (
"crypto/tls"
"encoding/json"
"fmt"
"io/ioutil"
@@ -14,6 +13,7 @@ import (
appConfig "github.com/xmpploadtesting/config"
"gosrc.io/xmpp"
"gosrc.io/xmpp/stanza"
"mellium.im/xmpp"
)
const rolingStockPresenceMessage = `ROLLING STOCK PRESENCE MESSAGE
@@ -102,9 +102,9 @@ func Init() {
Config: xmpp.Config{
TransportConfiguration: xmpp.TransportConfiguration{
Address: credential.Host + ":" + strconv.Itoa(credential.Port),
Domain: credential.Host,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
Address: credential.Host + ":" + strconv.Itoa(credential.Port),
Domain: credential.Host,
// TLSConfig: &tls.Config{InsecureSkipVerify: false},
},
Jid: credential.Jid + "@" + credential.Host,
Credential: xmpp.Password(credential.Credential),
@@ -196,7 +196,7 @@ func handleMessage(s xmpp.Sender, p stanza.Packet) {
log.Printf("<%v> received following message: %v", msg.To, msg.Body)
commandReplyDelay := int64(rand.Intn(appConfig.AppConfig.GeneralOptions.CommandReplyDelay))
log.Printf("Waiting FOR: %v", commandReplyDelay*1000000000)
// Delay For two seccond to allow all clients to connect
// Delay For two second to allow all clients to connect
time.Sleep(time.Duration(commandReplyDelay * 1000000000))
reply := stanza.Message{Attrs: stanza.Attrs{To: msg.From}, Body: `{"status": "OK"}`}