From ec18e5ce0755d5d1187e29014ca08836dee61f10 Mon Sep 17 00:00:00 2001 From: Pauline Middelink Date: Fri, 26 Feb 2016 02:52:13 +0100 Subject: [PATCH 1/4] Unneeded assignment --- acme/client.go | 1 - 1 file changed, 1 deletion(-) diff --git a/acme/client.go b/acme/client.go index be9843e2..690b440c 100644 --- a/acme/client.go +++ b/acme/client.go @@ -322,7 +322,6 @@ func (c *Client) RenewCertificate(cert CertificateResource, bundle bool) (Certif // Success - append the issuer cert to the issued cert. issuerCert = pemEncode(derCertificateBytes(issuerCert)) issuedCert = append(issuedCert, issuerCert...) - cert.Certificate = issuedCert } } From 6b0be6de614d2bd929ffcaa24f4b76c809aa11f4 Mon Sep 17 00:00:00 2001 From: Pauline Middelink Date: Fri, 26 Feb 2016 02:56:17 +0100 Subject: [PATCH 2/4] Update help+README for missing RFC2136_TSIG_ALGORITHM environment setting. --- README.md | 2 +- cli.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d1807aa..c75a2e85 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ GLOBAL OPTIONS: digitalocean: DO_AUTH_TOKEN dnsimple: DNSIMPLE_EMAIL, DNSIMPLE_API_KEY route53: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION - rfc2136: RFC2136_TSIG_KEY, RFC2136_TSIG_SECRET, RFC2136_NAMESERVER, RFC2136_ZONE + rfc2136: RFC2136_TSIG_KEY, RFC2136_TSIG_SECRET, RFC2136_TSIG_ALGORITHM, RFC2136_NAMESERVER, RFC2136_ZONE manual: none --help, -h show help --version, -v print the version diff --git a/cli.go b/cli.go index 97d3a816..e08f809c 100644 --- a/cli.go +++ b/cli.go @@ -124,7 +124,7 @@ func main() { "\n\tdigitalocean: DO_AUTH_TOKEN" + "\n\tdnsimple: DNSIMPLE_EMAIL, DNSIMPLE_API_KEY" + "\n\troute53: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION" + - "\n\trfc2136: RFC2136_TSIG_KEY, RFC2136_TSIG_SECRET, RFC2136_NAMESERVER, RFC2136_ZONE" + + "\n\trfc2136: RFC2136_TSIG_KEY, RFC2136_TSIG_SECRET, RFC2136_TSIG_ALGORITHM, RFC2136_NAMESERVER, RFC2136_ZONE" + "\n\tmanual: none", }, } From 96762fa6ba5b14debae825ea1ed1f984aee02f30 Mon Sep 17 00:00:00 2001 From: Pauline Middelink Date: Fri, 26 Feb 2016 02:57:16 +0100 Subject: [PATCH 3/4] Add --nobundle flag to supress the default creation of certificate bundle. --- cli.go | 10 ++++++++++ cli_handlers.go | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cli.go b/cli.go index e08f809c..a02ad78e 100644 --- a/cli.go +++ b/cli.go @@ -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.", + }, }, }, } diff --git a/cli_handlers.go b/cli_handlers.go index e6e71cbe..2b614ade 100644 --- a/cli_handlers.go +++ b/cli_handlers.go @@ -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()) } From 3b56b5a3e29a148f389275030827a33e946d9404 Mon Sep 17 00:00:00 2001 From: Pauline Middelink Date: Sat, 27 Feb 2016 10:46:13 +0100 Subject: [PATCH 4/4] As per request, renamed nobundle to no-bundle to be more in line with the other multi word switches. --- cli.go | 4 ++-- cli_handlers.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli.go b/cli.go index a02ad78e..b23adc21 100644 --- a/cli.go +++ b/cli.go @@ -52,7 +52,7 @@ func main() { Action: run, Flags: []cli.Flag{ cli.BoolFlag{ - Name: "nobundle", + Name: "no-bundle", Usage: "Do not create a certificate bundle by adding the issuers certificate to the new certificate.", }, }, @@ -77,7 +77,7 @@ func main() { Usage: "Used to indicate you want to reuse your current private key for the new certificate.", }, cli.BoolFlag{ - Name: "nobundle", + Name: "no-bundle", Usage: "Do not create a certificate bundle by adding the issuers certificate to the new certificate.", }, }, diff --git a/cli_handlers.go b/cli_handlers.go index 2b614ade..32f4a8f4 100644 --- a/cli_handlers.go +++ b/cli_handlers.go @@ -198,7 +198,7 @@ func run(c *cli.Context) { logger().Fatal("Please specify --domains or -d") } - cert, failures := client.ObtainCertificate(c.GlobalStringSlice("domains"), !c.Bool("nobundle"), nil) + cert, failures := client.ObtainCertificate(c.GlobalStringSlice("domains"), !c.Bool("no-bundle"), 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, !c.Bool("nobundle")) + newCert, err := client.RenewCertificate(certRes, !c.Bool("no-bundle")) if err != nil { logger().Fatalf("%s", err.Error()) }