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

Fix invalid arguments to exception #216

Closed
wants to merge 1 commit into from

Conversation

wilsonge
Copy link

@wilsonge wilsonge commented Apr 6, 2021

SUMMARY

Fixes the fact there are invalid arguments to the ACME Exception causing a hiding of any invalid errors from ACME

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ACME Certificate

ADDITIONAL INFORMATION

Create an invalid record identifier for a let's encrypt certificate and try and create a certificate.

Before:

"/tmp/ansible_acme_certificate_payload_QGwNTg/ansible_acme_certificate_payload.zip/ansible_collections/community/crypto/plugins/module_utils/acme/challenges.py", line 240, in raise_error
TypeError: __init__() got an unexpected keyword argument 'identifier'

After:

msg": "ACME request failed for None with HTTP status None. The JSON error result: {u'status': u'invalid', u'challenges': [{u'status': u'invalid', u'url': u'https://acme-staging-v02.api.letsencrypt.org/acme/chall-v3/<removed>/<removed>', u'token': u'<removed>', u'error': {u'status': 403, u'type': u'urn:ietf:params:acme:error:unauthorized', u'detail': u'Incorrect TXT record \"<removed>\" found at _acme-challenge.<removed>'}, u'validated': u'2021-04-06T16:27:29Z', u'type': u'dns-01'}], u'identifier': {u'type': u'dns', u'value': u'<removed>'}, 'uri': u'https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/23306744', u'expires': u'2021-04-13T16:26:53Z'}",
    "other": {
        "http_status": null,
        "http_url": null
    }
}

@felixfontein
Copy link
Contributor

@wilsonge thanks for the PR! I don't think this is the correct fix though (and there are some more problems with that exception in some other places). I'm currently preparing another PR for it.

@felixfontein felixfontein mentioned this pull request Apr 6, 2021
@wilsonge
Copy link
Author

wilsonge commented Apr 7, 2021

That indeed looks way better - Thankyou!

@wilsonge wilsonge closed this Apr 7, 2021
@felixfontein
Copy link
Contributor

@wilsonge in any case, thanks for reporting this problem by creating this PR :)

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

Successfully merging this pull request may close these issues.

2 participants