aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/batch/main.go27
1 files changed, 25 insertions, 2 deletions
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)
+ }
}
}