I was keen to check the Openprovider.com support in the latest Acme.sh plugin (V4.18), but it failed each time. This is in OPNsense 26.7.9.
The fix is to add "return 0" at the end of _openprovider_prepare_credentials() in /usr/local/share/examples/acme.sh/dnsapi/dns_openprovider_rest.sh:
_openprovider_prepare_credentials() {
OPENPROVIDER_REST_USERNAME="${OPENPROVIDER_REST_USERNAME:-$(_readaccountconf_mutable OPENPROVIDER_REST_USERNAME)}"
OPENPROVIDER_REST_PASSWORD="${OPENPROVIDER_REST_PASSWORD:-$(_readaccountconf_mutable OPENPROVIDER_REST_PASSWORD)}"
if [ -z "$OPENPROVIDER_REST_USERNAME" ] || [ -z "$OPENPROVIDER_REST_PASSWORD" ]; then
OPENPROVIDER_REST_USERNAME=""
OPENPROVIDER_REST_PASSWORD=""
_err "You didn't specify the Openprovider username or password yet."
return 1
fi
#save the credentials to the account conf file.
_saveaccountconf_mutable OPENPROVIDER_REST_USERNAME "$OPENPROVIDER_REST_USERNAME"
_saveaccountconf_mutable OPENPROVIDER_REST_PASSWORD "$OPENPROVIDER_REST_PASSWORD"
return 0
}
I have opened an issue on github: https://github.com/acmesh-official/acme.sh/issues/7409
Ben
A reply on github pointed me to the cause of this problem. It wasn't in Acme.sh, but in OPNSense.
I found that generateKey() creates the directory and account files, but is skipped for already registered accounts. The fixConfig() method doesn't recreate them if the directory is missing.
I ran the existing OPNsense register-account command line action, which recreated account.conf and restored the existing account key. And I removed the workaround from dns_openprovider_rest.sh and issued the wildcard certificate again.
Everything worked perfectly, with the original acme.sh code. So this wasn't an acme.sh bug after all, but apparently an OPNsense account configuration issue. Still not sure why the directory was missing in the first place.