afosto / yaac

Yet another ACME client: a decoupled LetsEncrypt client
Other
219 stars 85 forks source link

Debugging repeated validation failure #31

Closed ndmgrphc closed 3 years ago

ndmgrphc commented 3 years ago

When everything works except for validate() it's quite hard to debug the actual http validation. This is failing but I can't see why. Self test is fine.

foreach ($authorizations as $authorization) {
    $client->validate($authorization->getHttpChallenge(), 15);
}

Would it be better to expose underlying errors with validate's requests to help debug issues?

bakkerpeter commented 3 years ago

When the self test is fine (for HTTP challenges) it is most likely that your machine is able to reach the URL your are verifying but LetsEncrypt is not. This might be the case when your DNS records to your domain are not set up properly. For example a faulty AAAA record (pointing to a different server - but not visible to you since your connection does not use IPV6) could be causing issues here. I agree that logging could be optimised but when LE is not able to test de domain on all - in the DNS propagated servers for your domain(s) - validation will fail.

Would it be better to expose underlying errors with validate's requests to help debug issues?

I think we could look at some PSR logging interface that is passed along with the client, feel free to send a PR in :)