Skip to content

Commit 2480592

Browse files
committed
add better SSL key logging
1 parent 4694df5 commit 2480592

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ssl.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"fmt"
5+
"log"
56
"os"
67
"path/filepath"
78
"strings"
@@ -22,18 +23,22 @@ func initSSL(certPath, keyPath string) ([]byte, error) {
2223

2324
func initSSLKey(keyPath string) (out []byte, err error) {
2425
if fileExists(keyPath) {
26+
log.Println("using existing SSL key:", keyPath)
2527
return
2628
}
2729

2830
if err = mkdirP(keyPath); err != nil {
2931
return
3032
}
3133

34+
log.Println("SSL key does not exist")
35+
log.Println("creating", keyPath)
3236
return runCommand(fmt.Sprintf("openssl genrsa -out %s 4096", keyPath))
3337
}
3438

3539
func initSSLCert(certPath, keyPath string) (out []byte, err error) {
3640
if fileExists(certPath) {
41+
log.Println("using existing SSL cert:", certPath)
3742
return
3843
}
3944

@@ -63,6 +68,8 @@ func initSSLCert(certPath, keyPath string) (out []byte, err error) {
6368
certPath,
6469
}
6570

71+
log.Println("SSL cert does not exist")
72+
log.Println("creating", certPath)
6673
return runCommand("openssl " + strings.Join(args, " "))
6774
}
6875

@@ -72,6 +79,8 @@ func initRndFile() (out []byte, err error) {
7279
return
7380
}
7481

82+
log.Println("openssl random seed file does not exist")
83+
log.Println("creating", rndPath)
7584
command := fmt.Sprintf("openssl rand -out %s -hex 256", rndPath)
7685
return runCommand(command)
7786
}

0 commit comments

Comments
 (0)