Skip to content

Commit

Permalink
Write auto-generated icinga certs to disk (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalsaha authored Mar 28, 2018
1 parent c240a35 commit f7ca9da
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/icinga/configurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,15 @@ func (c *Configurator) LoadConfig(userInput envconfig.LoaderFunc) (*Config, erro
if err != nil {
return nil, err
}
_, _, err := store.NewClientCertPair("icinga")
serverCert, serverKey, err := store.NewClientCertPair("icinga")
if err != nil {
return nil, err
}
err = afero.WriteFile(fs, store.CertFile("icinga"), []byte(serverCert), 0755)
if err != nil {
return nil, err
}
err = afero.WriteFile(fs, store.KeyFile("icinga"), []byte(serverKey), 0644)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit f7ca9da

Please sign in to comment.