Add domain to HTTP challenge errors
This commit is contained in:
parent
477fa15859
commit
3ed72c4e46
1 changed files with 4 additions and 4 deletions
|
@ -103,7 +103,7 @@ func (c *ChallengeHTTP) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||||
|
|
||||||
func (c *ChallengeHTTP) getTokenValue(ctx context.Context, token, domain string) []byte {
|
func (c *ChallengeHTTP) getTokenValue(ctx context.Context, token, domain string) []byte {
|
||||||
logger := log.FromContext(ctx)
|
logger := log.FromContext(ctx)
|
||||||
logger.Debugf("Retrieving the ACME challenge for token %s...", token)
|
logger.Debugf("Retrieving the ACME challenge for %s (token %q)...", domain, token)
|
||||||
|
|
||||||
var result []byte
|
var result []byte
|
||||||
|
|
||||||
|
@ -112,13 +112,13 @@ func (c *ChallengeHTTP) getTokenValue(ctx context.Context, token, domain string)
|
||||||
defer c.lock.RUnlock()
|
defer c.lock.RUnlock()
|
||||||
|
|
||||||
if _, ok := c.httpChallenges[token]; !ok {
|
if _, ok := c.httpChallenges[token]; !ok {
|
||||||
return fmt.Errorf("cannot find challenge for token %s", token)
|
return fmt.Errorf("cannot find challenge for token %q (%s)", token, domain)
|
||||||
}
|
}
|
||||||
|
|
||||||
var ok bool
|
var ok bool
|
||||||
result, ok = c.httpChallenges[token][domain]
|
result, ok = c.httpChallenges[token][domain]
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("cannot find challenge for domain %s", domain)
|
return fmt.Errorf("cannot find challenge for %s (token %q)", domain, token)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -132,7 +132,7 @@ func (c *ChallengeHTTP) getTokenValue(ctx context.Context, token, domain string)
|
||||||
ebo.MaxElapsedTime = 60 * time.Second
|
ebo.MaxElapsedTime = 60 * time.Second
|
||||||
err := backoff.RetryNotify(safe.OperationWithRecover(operation), ebo, notify)
|
err := backoff.RetryNotify(safe.OperationWithRecover(operation), ebo, notify)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Errorf("Cannot retrieve the ACME challenge for token %v: %v", token, err)
|
logger.Errorf("Cannot retrieve the ACME challenge for %s (token %q): %v", domain, token, err)
|
||||||
return []byte{}
|
return []byte{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue