Skip to content

Commit

Permalink
fix(pki): export certificates in the given path
Browse files Browse the repository at this point in the history
  • Loading branch information
streambinder committed Jun 14, 2022
1 parent 6eeabd3 commit c7df8c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pki/crt.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"math/big"
"net"
"os"
"path/filepath"
"time"
)

Expand Down Expand Up @@ -82,7 +83,7 @@ func Export(crt *CRT, key *Key, path string) error {
return err
}

certOut, err := os.Create("crt.pem")
certOut, err := os.Create(filepath.Join(path, "crt.pem"))
if err != nil {
return err
}
Expand All @@ -95,7 +96,7 @@ func Export(crt *CRT, key *Key, path string) error {
return err
}

keyOut, err := os.OpenFile("key.pem", os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
keyOut, err := os.OpenFile(filepath.Join(path, "key.pem"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
if err != nil {
return err
}
Expand Down

0 comments on commit c7df8c2

Please sign in to comment.