Add hostname to server certs

This commit is contained in:
2021-12-04 10:19:59 +01:00
parent bf9f8d80cd
commit 1b2cb55843
2 changed files with 15 additions and 6 deletions

View File

@@ -101,6 +101,10 @@ func main() {
Name: "out-dir",
Usage: "Directory where certificates will be stored.",
},
&cli.StringFlag{
Name: "hostname",
Usage: "Hostname used for server certificate.",
},
},
Action: ActionGencerts,
},
@@ -332,7 +336,11 @@ func ActionGencerts(c *cli.Context) error {
if c.IsSet("out-dir") {
outDir = c.String("out-dir")
}
return certs.GenAllCerts(outDir)
if !c.IsSet("hostname") {
return fmt.Errorf("--hostname required")
}
hostname := c.String("hostname")
return certs.GenAllCerts(outDir, hostname)
}
func ActionInitConfig(c *cli.Context) error {