Actually use TLS config passed to method.
This commit is contained in:
parent
f1c999d623
commit
01cff4b3ba
|
|
@ -17,7 +17,7 @@ func main() {
|
||||||
jid, _ := xmpp.ParseJID(*jid)
|
jid, _ := xmpp.ParseJID(*jid)
|
||||||
password := *password
|
password := *password
|
||||||
|
|
||||||
x, err := xmpp.NewClientXMPP(jid, password, &xmpp.ClientConfig{})
|
x, err := xmpp.NewClientXMPP(jid, password, &xmpp.ClientConfig{InsecureSkipVerify: true})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ func NewStream(addr string) (*Stream, error) {
|
||||||
// Upgrade the stream's underlying net conncetion to TLS.
|
// Upgrade the stream's underlying net conncetion to TLS.
|
||||||
func (stream *Stream) UpgradeTLS(config *tls.Config) error {
|
func (stream *Stream) UpgradeTLS(config *tls.Config) error {
|
||||||
|
|
||||||
conn := tls.Client(stream.conn, &tls.Config{InsecureSkipVerify: true})
|
conn := tls.Client(stream.conn, config)
|
||||||
if err := conn.Handshake(); err != nil {
|
if err := conn.Handshake(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue