I'm trying to use the acme package for pfsense. I'm getting on _on_issue_err. From what I can tell, the relevant part on the issuecert log is:
invalid domain='_acme-challeng.example.com'
Error add txt for domain:_acme-challenge.example.com
_on_issue_err
At first I thought it had trouble with subdomains, but it seems to also have the same problem with domains. I've had trouble before making the relevant _acme-challenge.subdomain.example.com, and after. The script seems to have no issue logging in, but actually adding the TXT records seems to be an issue. I will note that when I'm logged in, my relevant TXT record shows up as _acme-challenge.subdomain, which may or may not be having an effect.
I did some more testing. In _get_root(), the results of _authget() fail to get a response that contains "serial". Using _info to help print out useful information, $_response is {"auth": false, "ok": false}. My username and password are correct, and the script gets past _1984hosting_login(), but fails in _get_root().
I chased it down to the login cookie not getting set correctly. On line 171 of dns_1984hosting.sh there is a broken grep search. The HTTP header has set-cookie, but the grep is looking for Set-Cookie, so $One984HOSTING_COOKIE is left empty. Correcting the grep to look for set-cookie fixes it.
I made a pull request (#2961) that should fix this. I've tested it, and it seems to work fine. The script finished and I can see the new TXT record for my domain.
After @Neilpang reviewed my pull request, I had to look at why there was difference in capitalization. It came down to a change between HTTP/1.1 -> HTTP/2. HTTP/1.1 is case insensitive, so anything goes with upper/lower case. HTTP/2 is technically also case insensitive, but valid HTTP/2 header fields are lower case. I think the script was originally tested with only HTTP/1.1 header fields. Though technically they are case insensitive, so the script could have failed with a change of case in the HTTP/1.1 set-cookie: header field as well.
It seems they have an experimental API. When asking their tech support they provided me with a python-script to used with Dehydrated and the warning "it is hidden, half-cooked and not tested with wildcards". Couldn't actually get the script to work with Dehydrated on OpenWRT, but looking at the code the API should work also with acme.sh:
https://api.1984.is/1.0/freedns/letsencrypt/?apikey=yourapikey&domain=yourdomain&challenge=generatedchallenge
Hmm, I tried it with the login option, but for unclear reasons it does not allow me to log in. Edit: I did get manual mode working though.
It would be much appreciated if someone who knows the system better than me could try it with the API and make a script for it. I had a look if there was a similar api with a simple webhook (the old Linode one maybe?), but I couldn't quite wrapp my head around how the script works exactly.