diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/acme/main.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cmd/acme/main.go b/cmd/acme/main.go index cda91e0..b6ee054 100644 --- a/cmd/acme/main.go +++ b/cmd/acme/main.go @@ -84,17 +84,22 @@ func requestCert(prov *acme.Provider, acc *acme.Account, d domain) error { } } - des := acme.NewDesire() + sols := make(acme.Solvers) + if d.Webroot != "" { - des.RegisterSolver(acme.NewWebrootSolver(d.Webroot)) + sols[acme.ChallengeHTTP] = acme.NewWebrootSolver(d.Webroot) } else { - des.RegisterSolver(httpSol) - des.RegisterSolver(tlsSol) + if httpSol != nil { + sols[acme.ChallengeHTTP] = httpSol + } + if tlsSol != nil { + sols[acme.ChallengeTLS] = tlsSol + } } for _, an := range d.Altnames { log.Println("Authorize", an) - if err := prov.Authorize(acc, des, an); err != nil { + if err := prov.Authorize(acc, sols, an); err != nil { return err } } |