diff options
author | Gary Kim <gary@garykim.dev> | 2020-08-30 07:49:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-30 13:49:26 +0200 |
commit | a0741d99b80d7da1c063853382756b3a9689f6a7 (patch) | |
tree | 86b6954d34558fe3a753284dea52928a031edc7a /bridge/nctalk | |
parent | c63f08c8113598149f312bffd3fbdf1970660639 (diff) | |
download | matterbridge-msglm-a0741d99b80d7da1c063853382756b3a9689f6a7.tar.gz matterbridge-msglm-a0741d99b80d7da1c063853382756b3a9689f6a7.tar.bz2 matterbridge-msglm-a0741d99b80d7da1c063853382756b3a9689f6a7.zip |
Add TLSConfig to nctalk (#1195)
Signed-off-by: Gary Kim <gary@garykim.dev>
Diffstat (limited to 'bridge/nctalk')
-rw-r--r-- | bridge/nctalk/nctalk.go | 15 |
1 files changed, 13 insertions, 2 deletions
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 |