Ephenodrom/Dart-Acme-Client

ChallengeError is failing when parsing json due to incorrect 'status' type.

bsutton opened this issue · 3 comments

I'm seeing a cast exception when ChallengeErrorFromJson is being thrown due to a '400'.

The problem is that the code assumes the status is a string but it would appear that acme is returning an it.

Map (3 items)
"type" -> "urn:ietf:params:acme:error:connection"
"detail" -> "34.69.220.126: Fetching http://xxxxxx/.well-known/acme-challenge/XXXXX Timeout d…"
"status" -> 400

Note the status is an int.

The timeout is occurring as I'm behind a NAT which isn't configured correct but this still seems to be an issue that needs to be looked at.

What I'm not certain is whether the status is always an int.

I found this issue whilst trying to get shelf_letsencrypt running.

I've also reported an issue there:

gmpassos/shelf_letsencrypt#9

The package was written by me to better understand the ACME protocol, so it may well be that there are still one or two bugs here. In the end, however, I was able to issue certificates via Let's Encrypt under real conditions. I am not sure if this is a special issue, cause i cannot find "urn:ietf:params:acme:error:connection" in the RFC. I would suggest to change it to an int and then try to manually issue a certificate via Let's encrypt by writing a small dart script to invoke the methods manually. If you can confirm that the package is still working we can change the string to int.

@bsutton Ok sounds good.