Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Commit

Permalink
use correct paths for custom TLS CA cert and key
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
  • Loading branch information
ehazlett committed Jan 27, 2015
1 parent c209704 commit 371194e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions host.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ func (h *Host) ConfigureAuth() error {
return err
}

caCertPath := filepath.Join(utils.GetMachineDir(), "ca.pem")
caKeyPath := filepath.Join(utils.GetMachineDir(), "key.pem")
serverCertPath := filepath.Join(h.storePath, "server.pem")
serverKeyPath := filepath.Join(h.storePath, "server-key.pem")

Expand All @@ -133,7 +131,7 @@ func (h *Host) ConfigureAuth() error {

log.Debugf("generating server cert: %s", serverCertPath)

if err := utils.GenerateCert([]string{ip}, serverCertPath, serverKeyPath, caCertPath, caKeyPath, org, bits); err != nil {
if err := utils.GenerateCert([]string{ip}, serverCertPath, serverKeyPath, h.CaCertPath, h.PrivateKeyPath, org, bits); err != nil {
return fmt.Errorf("error generating server cert: %s", err)
}

Expand All @@ -150,7 +148,7 @@ func (h *Host) ConfigureAuth() error {
}

// upload certs and configure TLS auth
caCert, err := ioutil.ReadFile(caCertPath)
caCert, err := ioutil.ReadFile(h.CaCertPath)
if err != nil {
return err
}
Expand Down

0 comments on commit 371194e

Please sign in to comment.