Add SkipTLSVerify option for mattermost, allows selfsigned certificates

This commit is contained in:
Wim
2015-10-25 01:00:19 +02:00
parent 43738dbc89
commit 8b6a00d1c5
5 changed files with 30 additions and 14 deletions

View File

@@ -20,7 +20,8 @@ func NewBridge(name string, config *Config) *Bridge {
b := &Bridge{}
b.Config = config
b.m = matterhook.New(b.Config.Mattermost.URL,
matterhook.Config{Port: b.Config.Mattermost.Port, Token: b.Config.Mattermost.Token})
matterhook.Config{Port: b.Config.Mattermost.Port, Token: b.Config.Mattermost.Token,
InsecureSkipVerify: b.Config.Mattermost.SkipTLSVerify})
b.i = b.createIRC(name)
go b.handleMatter()
return b
@@ -68,7 +69,11 @@ func (b *Bridge) Send(nick string, message string) error {
matterMessage := matterhook.OMessage{IconURL: b.Config.Mattermost.IconURL}
matterMessage.UserName = nick
matterMessage.Text = message
b.m.Send(matterMessage)
err := b.m.Send(matterMessage)
if err != nil {
log.Println(err)
return err
}
return nil
}