Add --nobundle flag to supress the default creation of certificate bundle.

This commit is contained in:
Pauline Middelink 2016-02-26 02:57:16 +01:00
parent 6b0be6de61
commit 96762fa6ba
2 changed files with 12 additions and 2 deletions

10
cli.go
View file

@ -50,6 +50,12 @@ func main() {
Name: "run",
Usage: "Register an account, then create and install a certificate",
Action: run,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "nobundle",
Usage: "Do not create a certificate bundle by adding the issuers certificate to the new certificate.",
},
},
},
{
Name: "revoke",
@ -70,6 +76,10 @@ func main() {
Name: "reuse-key",
Usage: "Used to indicate you want to reuse your current private key for the new certificate.",
},
cli.BoolFlag{
Name: "nobundle",
Usage: "Do not create a certificate bundle by adding the issuers certificate to the new certificate.",
},
},
},
}

View file

@ -198,7 +198,7 @@ func run(c *cli.Context) {
logger().Fatal("Please specify --domains or -d")
}
cert, failures := client.ObtainCertificate(c.GlobalStringSlice("domains"), true, nil)
cert, failures := client.ObtainCertificate(c.GlobalStringSlice("domains"), !c.Bool("nobundle"), nil)
if len(failures) > 0 {
for k, v := range failures {
logger().Printf("[%s] Could not obtain certificates\n\t%s", k, v.Error())
@ -295,7 +295,7 @@ func renew(c *cli.Context) {
certRes.Certificate = certBytes
newCert, err := client.RenewCertificate(certRes, true)
newCert, err := client.RenewCertificate(certRes, !c.Bool("nobundle"))
if err != nil {
logger().Fatalf("%s", err.Error())
}