Skip to content

Commit

Permalink
Fix null pointer for some SSL configs in heartbeat
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewvc committed Jun 21, 2021
1 parent ccc2ac9 commit 110ae69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions heartbeat/monitors/active/http/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type Config struct {
Password string `config:"password"`

// configure tls (if not configured HTTPS will use system defaults)
TLS *tlscommon.Config `config:"ssl"`
TLS tlscommon.Config `config:"ssl"`

// http(s) ping validation
Check checkConfig `config:"check"`
Expand Down Expand Up @@ -169,7 +169,7 @@ func (c *Config) Validate() error {

// updateScheme looks at TLS config to decide if http or https should be used to update the host
updateScheme := func(host string) string {
if c.TLS != nil && *c.TLS.Enabled == true {
if c.TLS.IsEnabled() {
return fmt.Sprint("https://", host)
}
return fmt.Sprint("http://", host)
Expand Down
2 changes: 1 addition & 1 deletion heartbeat/monitors/active/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func create(
return plugin.Plugin{}, err
}

tls, err := tlscommon.LoadTLSConfig(config.TLS)
tls, err := tlscommon.LoadTLSConfig(&config.TLS)
if err != nil {
return plugin.Plugin{}, err
}
Expand Down

0 comments on commit 110ae69

Please sign in to comment.