mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-09 12:28:49 +03:00
letsencrypt: Better logic for handling issuance failures
This fixes a bug with the -agree flag
This commit is contained in:
parent
be0fb0053d
commit
b143bbdbaa
1 changed files with 7 additions and 6 deletions
|
@ -89,15 +89,16 @@ func Activate(configs []server.Config) ([]server.Config, error) {
|
||||||
// Build an error string to return, using all the failures in the list.
|
// Build an error string to return, using all the failures in the list.
|
||||||
var errMsg string
|
var errMsg string
|
||||||
|
|
||||||
// An agreement error means we need to prompt the user (once) with updated terms
|
// If an error is because of updated SA, only prompt user for agreement once
|
||||||
// while they're still here.
|
var promptedForAgreement bool
|
||||||
var promptedUpdatedTerms bool
|
|
||||||
|
|
||||||
for domain, obtainErr := range failures {
|
for domain, obtainErr := range failures {
|
||||||
// If the failure was simply because the terms have changed, re-prompt and re-try
|
// If the failure was simply because the terms have changed, re-prompt and re-try
|
||||||
if tosErr, ok := obtainErr.(acme.TOSError); ok && !promptedUpdatedTerms {
|
if tosErr, ok := obtainErr.(acme.TOSError); ok {
|
||||||
Agreed = promptUserAgreement(tosErr.Detail, true) // TODO: Use latest URL
|
if !Agreed && !promptedForAgreement {
|
||||||
promptedUpdatedTerms = true
|
Agreed = promptUserAgreement(tosErr.Detail, true) // TODO: Use latest URL
|
||||||
|
promptedForAgreement = true
|
||||||
|
}
|
||||||
if Agreed {
|
if Agreed {
|
||||||
err := client.AgreeToTOS()
|
err := client.AgreeToTOS()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue