CLI: renew only the first domain (CommonName)

This commit is contained in:
xenolf 2015-12-15 21:10:47 +01:00
parent 102a9f756b
commit 2d385d3f41

View file

@ -173,7 +173,12 @@ func revoke(c *cli.Context) {
func renew(c *cli.Context) {
conf, _, client := setup(c)
for _, domain := range c.GlobalStringSlice("domains") {
if len(c.GlobalStringSlice("domains")) <= 0 {
logger().Fatal("Please specify at least one domain.")
}
domain := c.GlobalStringSlice("domains")[0]
// load the cert resource from files.
// We store the certificate, private key and metadata in different files
// as web servers would not be able to work with a combined file.
@ -193,7 +198,7 @@ func renew(c *cli.Context) {
}
if int(expTime.Sub(time.Now()).Hours() / 24.0) <= c.Int("days") {
continue
return
}
}
@ -223,4 +228,3 @@ func renew(c *cli.Context) {
saveCertRes(newCert, conf)
}
}