Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better way to get errors out of acme client #9

Open
bsutton opened this issue Dec 8, 2023 · 2 comments
Open

better way to get errors out of acme client #9

bsutton opened this issue Dec 8, 2023 · 2 comments

Comments

@bsutton
Copy link
Contributor

bsutton commented Dec 8, 2023

The AcmeClient.validate method has been returning an 'invalid' message.

This left me a little perplexed as I had no idea why the request was invalid.

In digging into the code I realised the problem was a firewall configuration.

The problem is that currently there is no way to get the 'root' error out of acme client.

I had a play with the response object returned from the second call to Dil().post in AcmeClient.validate and found that
the error was contained in:

response!.data['challenges'][0]['error']['detail']

"34.69.220.126: Fetching http://xxxxxx/.well-known/acme-challenge/-F7yZhEiUqqRgra8wcEaLUG01jq_A3TH4RbBJ63Q-JU: Timeout d…"

So this error makes it fairly clear what the problem is but it isn't very friendly to make the user dig through code to determine the problem.

I had a look at adding a field 'lastResponse' to the AcmeClient which exposes the error but it isn't an adequate solution as you have to know to dig into the 4 levels of the response map.

Is there a better solution for this?

@bsutton
Copy link
Contributor Author

bsutton commented Dec 9, 2023

So it turns out I had already raised an issue.

I'm not familiar enough with the RFC to understand all of the places we need to extract errors from.
We also need to consider how we surface those errors.
I would normally throw a custom exception but the current code based doesn't really use exceptions.

Suggestions?

@bsutton
Copy link
Contributor Author

bsutton commented Dec 15, 2023

This is probably the last big issue that needs to be resolved to make the package perfect.

I'm not going to have the time to look at this any time soon so if anyone else wants to have a crack at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant