Skip to content

More graceful warning on unauthorized API request (TransIP or generic?) #2505

@djoris

Description

@djoris

Due to user error, my API calls to TransIP failed. (If you must know: I forgot the toggle at my DNS provider to enable API.)

The warning I got was not descriptive to me, adding to the confusion:

Error creating TXT record: Unexpected character encountered while parsing value: Y. Path '', line 0, position 0.

Verbose logging helped me:

[DBUG] [HTTP] Send POST to https://api.transip.nl/v6/auth
[VERB] [HTTP] Request content: {"nonce":"9░░░░░░░░login":"░░░░","read_only":false,"expiration_time":"30 minutes","label":null,"global_key":true}
[VERB] [HTTP] Request completed with status Unauthorized
[VERB] [HTTP] Empty response

I think it would be more helpful if an error message would be given on the Unauthorized HTTP request, instead of failing on the empty response.

[DBUG] [.░░░░░░░░░.nl] Attempting to create DNS record under _acme-challenge.░░░░░░░░.nl...
[DBUG] [HTTP] Send POST to https://api.transip.nl/v6/auth
[VERB] [HTTP] Request content: {"nonce":"9░░░░░░░░░","login":"░░░░","read_only":false,"expiration_time":"30 minutes","label":null,"global_key":true}
[VERB] [HTTP] Request completed with status Unauthorized
[VERB] [HTTP] Empty response
[WARN] Error creating TXT record: Unexpected character encountered while parsing value: Y. Path '', line 0, position 0.
[DBUG] [
.░░░░░.nl] Failed to create record under _acme-challenge.░░░░░░░░░.nl
[EROR] [.░░░░░.nl] Error preparing for challenge answer
System.Exception: [
.░░░░░░.nl] Unable to prepare for challenge answer
at PKISharp.WACS.Plugins.ValidationPlugins.DnsValidation1.PrepareChallenge(ValidationContext context, Dns01ChallengeValidationDetails challenge) at PKISharp.WACS.Plugins.ValidationPlugins.Validation1.PrepareChallenge(ValidationContext context)
at PKISharp.WACS.RenewalValidator.Prepare(ValidationContext context, RunLevel runLevel)
[VERB] Starting post-validation cleanup
[VERB] Post-validation cleanup was succesful
[INFO] [*.░░░░░░░░░░.nl] Deactivating pending authorization
[DBUG] [HTTP] Send POST to https://acme-v02.api.letsencrypt.org/acme/authz-v3/304861148156

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions