From 58468eb705813aeab1bec8495458883ecf961e61 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 18 Mar 2016 20:26:39 +0100 Subject: FIXME: Error creating new cert :: Certificate public key must be different than account key --- cmd/batch/main.go | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'cmd') diff --git a/cmd/batch/main.go b/cmd/batch/main.go index 03036bf..8790c9a 100644 --- a/cmd/batch/main.go +++ b/cmd/batch/main.go @@ -2,6 +2,7 @@ package main import ( "log" + "path" "dim13.org/acme" ) @@ -71,8 +72,30 @@ func main() { if err != nil { log.Fatal(err) } - log.Println(*emails) - log.Println(*domains) + + for _, domain := range *domains { + log.Println("Authofize", domain) + err := prov.Authorize(sig, sol, domain) + if err != nil { + log.Fatal(err) + } + } + + log.Println("Request bundle for", *domains) + cert, err := prov.Bundle(sig, key, *domains, *emails) + if err != nil { + log.Fatal(err) + } + + c := Cert{ + Certificate: cert, + keyFile: path.Join(*baseDir, "private", (*domains)[0]+".key"), + crtFile: path.Join(*baseDir, "certs", (*domains)[0]+".pem"), + } + err = c.saveFiles() + if err != nil { + log.Fatal(err) + } } } -- cgit v1.2.3