From a0741d99b80d7da1c063853382756b3a9689f6a7 Mon Sep 17 00:00:00 2001 From: Gary Kim Date: Sun, 30 Aug 2020 07:49:26 -0400 Subject: Add TLSConfig to nctalk (#1195) Signed-off-by: Gary Kim --- bridge/nctalk/nctalk.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'bridge') diff --git a/bridge/nctalk/nctalk.go b/bridge/nctalk/nctalk.go index 7f7d8ab9..40836a4f 100644 --- a/bridge/nctalk/nctalk.go +++ b/bridge/nctalk/nctalk.go @@ -2,6 +2,7 @@ package nctalk import ( "context" + "crypto/tls" "strconv" "github.com/42wim/matterbridge/bridge" @@ -31,8 +32,18 @@ type Broom struct { func (b *Btalk) Connect() error { b.Log.Info("Connecting") - b.user = talk.NewUser(b.GetString("Server"), b.GetString("Login"), b.GetString("Password")) - _, err := b.user.Capabilities() + tconfig := &user.TalkUserConfig{ + TLSConfig: &tls.Config{ + InsecureSkipVerify: b.GetBool("SkipTLSVerify"), //nolint:gosec + }, + } + var err error + b.user, err = user.NewUser(b.GetString("Server"), b.GetString("Login"), b.GetString("Password"), tconfig) + if err != nil { + b.Log.Error("Config could not be used") + return err + } + _, err = b.user.Capabilities() if err != nil { b.Log.Error("Cannot Connect") return err -- cgit v1.2.3