Skip to content

Commit

Permalink
Merge pull request #15 from MarkSonghurst/master
Browse files Browse the repository at this point in the history
Panic when using TLS configuration (Go 1.7.4)
  • Loading branch information
christiangalsterer authored Jan 11, 2017
2 parents 962c8ce + 0de25e6 commit 71d259e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions beater/poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ func (p *Poller) runOneTime() error {
var tlsC *transport.TLSConfig
//tlsConfig, err = outputs.LoadTLSConfig(p.config.TLS)
tlsC, err = outputs.LoadTLSConfig(p.config.SSL)
tlsConfig = convertTLSConfig(tlsC)
if err != nil {
return err
}
tlsConfig = convertTLSConfig(tlsC)
p.request.TLSClientConfig(tlsConfig)
}

Expand Down Expand Up @@ -243,13 +243,12 @@ func mergeMaps(first map[string]interface{}, second map[string]interface{}, key
}

func convertTLSConfig(config *transport.TLSConfig) *tls.Config {
var tlsConfig *tls.Config
tlsConfig.Certificates = config.Certificates
tlsConfig.CipherSuites = config.CipherSuites
tlsConfig.RootCAs = config.RootCAs
tlsConfig.CurvePreferences = config.CurvePreferences
return tlsConfig

return &tls.Config{
Certificates: config.Certificates,
CipherSuites: config.CipherSuites,
RootCAs: config.RootCAs,
CurvePreferences: config.CurvePreferences,
}
}

func (p *Poller) Stop() {
Expand Down

0 comments on commit 71d259e

Please sign in to comment.