Add the possibility to disable certificat verification
This commit is contained in:
parent
7e9fd69879
commit
e2fbb6c8e3
|
|
@ -33,6 +33,7 @@ XMPP
|
||||||
* __xmpp_jid__ : Account JID
|
* __xmpp_jid__ : Account JID
|
||||||
* __xmpp_secret__ : Account password
|
* __xmpp_secret__ : Account password
|
||||||
* xmpp_debug : Enable debug log at true (default: false)
|
* xmpp_debug : Enable debug log at true (default: false)
|
||||||
|
* xmpp_verify_cert_validity : Enable certificate verification (default: true)
|
||||||
|
|
||||||
HTTP
|
HTTP
|
||||||
* http_port : HTTP port to bind (default: 9090, desactive: -1)
|
* http_port : HTTP port to bind (default: 9090, desactive: -1)
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ xmpp_server_port=5347
|
||||||
xmpp_jid=xmppsteam.kingpenguin.tk
|
xmpp_jid=xmppsteam.kingpenguin.tk
|
||||||
xmpp_secret=xmpp4steam_password
|
xmpp_secret=xmpp4steam_password
|
||||||
xmpp_debug=true
|
xmpp_debug=true
|
||||||
|
xmpp_verify_cert_validity=true
|
||||||
|
|
||||||
# HTTP informations
|
# HTTP informations
|
||||||
http_port=9090
|
http_port=9090
|
||||||
|
|
|
||||||
1
main.go
1
main.go
|
|
@ -63,6 +63,7 @@ func init() {
|
||||||
xmpp.JidStr = mapConfig["xmpp_jid"]
|
xmpp.JidStr = mapConfig["xmpp_jid"]
|
||||||
xmpp.Secret = mapConfig["xmpp_secret"]
|
xmpp.Secret = mapConfig["xmpp_secret"]
|
||||||
xmpp.Debug = mapConfig["xmpp_debug"] == "true"
|
xmpp.Debug = mapConfig["xmpp_debug"] == "true"
|
||||||
|
xmpp.VerifyCertValidity = mapConfig["xmpp_verify_cert_validity"] != "false" // Default TRUE
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@ var (
|
||||||
WaitMessageAnswers = make(map[string]*Confirmation)
|
WaitMessageAnswers = make(map[string]*Confirmation)
|
||||||
WaitIqMessages = make(map[string]*Confirmation)
|
WaitIqMessages = make(map[string]*Confirmation)
|
||||||
|
|
||||||
Debug = true
|
Debug = true
|
||||||
|
VerifyCertValidity = true
|
||||||
)
|
)
|
||||||
|
|
||||||
func Run() {
|
func Run() {
|
||||||
|
|
@ -75,7 +76,7 @@ func Run() {
|
||||||
if isComponent {
|
if isComponent {
|
||||||
comp = must(xmpp.NewComponentXMPP(stream, jid, Secret)).(*xmpp.XMPP)
|
comp = must(xmpp.NewComponentXMPP(stream, jid, Secret)).(*xmpp.XMPP)
|
||||||
} else {
|
} else {
|
||||||
comp = must(xmpp.NewClientXMPP(stream, jid, Secret, &xmpp.ClientConfig{InsecureSkipVerify: false})).(*xmpp.XMPP)
|
comp = must(xmpp.NewClientXMPP(stream, jid, Secret, &xmpp.ClientConfig{InsecureSkipVerify: !VerifyCertValidity})).(*xmpp.XMPP)
|
||||||
comp.Out <- xmpp.Presence{}
|
comp.Out <- xmpp.Presence{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue