forked from TrueCloudLab/lego
If any challenge fails - return an error
This commit is contained in:
parent
4801a4779e
commit
c849ca1b90
1 changed files with 2 additions and 13 deletions
|
@ -239,22 +239,11 @@ func (c *Client) ObtainSANCertificate(domains []string, bundle bool) (Certificat
|
||||||
}
|
}
|
||||||
|
|
||||||
errs := c.solveChallenges(challenges)
|
errs := c.solveChallenges(challenges)
|
||||||
for k, v := range errs {
|
// If any challenge fails - return. Do not generate partial SAN certificates.
|
||||||
failures[k] = v
|
if len(errs) > 0 {
|
||||||
}
|
|
||||||
|
|
||||||
if len(failures) == len(domains) {
|
|
||||||
return CertificateResource{}, failures
|
return CertificateResource{}, failures
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove failed challenges from slice
|
|
||||||
var succeededChallenges []authorizationResource
|
|
||||||
for _, chln := range challenges {
|
|
||||||
if failures[chln.Domain] == nil {
|
|
||||||
succeededChallenges = append(succeededChallenges, chln)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
logf("[INFO] acme: Validations succeeded; requesting certificates")
|
logf("[INFO] acme: Validations succeeded; requesting certificates")
|
||||||
|
|
||||||
cert, err := c.requestCertificate(succeededChallenges, bundle)
|
cert, err := c.requestCertificate(succeededChallenges, bundle)
|
||||||
|
|
Loading…
Reference in a new issue