Add hostname to server certs
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user