aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/acme/dim13.yml2
-rw-r--r--cmd/acme/main.go8
-rw-r--r--cmd/batch/main.go19
3 files changed, 13 insertions, 16 deletions
diff --git a/cmd/acme/dim13.yml b/cmd/acme/dim13.yml
index 3124ba3..fa2a586 100644
--- a/cmd/acme/dim13.yml
+++ b/cmd/acme/dim13.yml
@@ -16,6 +16,8 @@ desire:
domain:
- altnames:
- www.dim13.org
+ - mail.dim13.org
+ - git.dim13.org
hook: [ nginx ]
- altnames:
- git.dim13.org
diff --git a/cmd/acme/main.go b/cmd/acme/main.go
index faff013..6dc19db 100644
--- a/cmd/acme/main.go
+++ b/cmd/acme/main.go
@@ -49,7 +49,7 @@ func register(prov *acme.Provider, d desire) (*acme.Signer, error) {
}
log.Println("Register", con)
- if err := prov.Register(sig, con, agree); err != nil {
+ if err := prov.Register(con, agree); err != nil {
return nil, err
}
return sig, nil
@@ -71,7 +71,7 @@ func loadAccount(prov *acme.Provider, d desire) error {
return nil
}
-func requestCert(prov *acme.Provider, sig *acme.Signer, d domain) error {
+func requestCert(prov *acme.Provider, d domain) error {
c, err := d.Load()
if err != nil {
c.PrivateKey, err = acme.NewKey(d.KeySize)
@@ -100,13 +100,13 @@ func requestCert(prov *acme.Provider, sig *acme.Signer, d domain) error {
for _, alt := range d.Altnames {
log.Println("Authorize", alt)
- if err := prov.Authorize(sig, sols, alt); err != nil {
+ if err := prov.Authorize(sols, alt); err != nil {
return err
}
}
log.Println("Request bundle for", d.Altnames)
- cert, err := prov.Bundle(sig, c.PrivateKey, d.Altnames, nil)
+ cert, err := prov.Bundle(c.PrivateKey, d.Altnames, nil)
if err != nil {
return err
}
diff --git a/cmd/batch/main.go b/cmd/batch/main.go
index 0be2087..964f6f3 100644
--- a/cmd/batch/main.go
+++ b/cmd/batch/main.go
@@ -30,20 +30,13 @@ func main() {
if err != nil {
log.Fatal(err)
}
- _ = sol
-
- log.Println("Dial", *provider)
- prov, err := acme.DialProvider(*provider)
- if err != nil {
- log.Fatal(err)
- }
for _, c := range crt {
if c.IsValid(*graceTime) && !*force {
log.Println("Skip", c)
continue
}
- csr, err := acme.NewCSR(c.PrivateKey, c.Leaf.DNSNames, c.Leaf.EmailAddresses)
+ csr, err := acme.NewCSR(c.PrivateKey, c.Leaf.DNSNames, acme.GetMail(c.Leaf))
if err != nil {
log.Println(err)
continue
@@ -55,7 +48,9 @@ func main() {
if err != nil {
log.Fatal(err)
}
- sig, err := acme.NewSigner(key)
+
+ log.Println("Dial", *provider)
+ prov, err := acme.DialProvider(*provider, key)
if err != nil {
log.Fatal(err)
}
@@ -68,21 +63,21 @@ func main() {
con = append(con, m)
log.Println("Register", con)
- err = prov.Register(sig, con, agree)
+ err = prov.Register(con, agree)
if err != nil {
log.Fatal(err)
}
for _, domain := range *domains {
log.Println("Authofize", domain)
- err := prov.Authorize(sig, sol, domain)
+ err := prov.Authorize(sol, domain)
if err != nil {
log.Fatal(err)
}
}
log.Println("Request bundle for", *domains)
- cert, err := prov.Bundle(sig, key, *domains, *email)
+ cert, err := prov.Bundle(key, *domains, *email)
if err != nil {
log.Fatal(err)
}