Can not init api for

Hi
My domain is: stanworth.cloud

I ran this command:

root@stanworth-cloud:/home/acmeuser/.acme.sh# su acmeuser
acmeuser@stanworth-cloud:~/.acme.sh$ acme.sh --issue -d stanworth.cloud --keylength 4096 -w /var/www/letsencrypt --key-file /etc/letsencrypt/rsa-certs/privkey.pem --ca-file /etc/letsencrypt/rsa-certs/chain.pem --cert-file /etc/letsencrypt/rsa-certs/cert.pem --fullchain-file /etc/letsencrypt/rsa-certs/fullchain.pem --debug

It produced this output:

[Sat Jul 10 01:14:18 CST 2021] Lets find script dir.
[Sat Jul 10 01:14:18 CST 2021] _SCRIPT_='/home/acmeuser/.acme.sh/acme.sh'
[Sat Jul 10 01:14:18 CST 2021] _script='/home/acmeuser/.acme.sh/acme.sh'
[Sat Jul 10 01:14:18 CST 2021] _script_home='/home/acmeuser/.acme.sh'
[Sat Jul 10 01:14:18 CST 2021] Using config home:/home/acmeuser/.acme.sh
https://github.com/acmesh-official/acme.sh
v3.0.0
[Sat Jul 10 01:14:18 CST 2021] Running cmd: issue
[Sat Jul 10 01:14:18 CST 2021] _main_domain='stanworth.cloud'
[Sat Jul 10 01:14:18 CST 2021] _alt_domains='no'
[Sat Jul 10 01:14:18 CST 2021] Using config home:/home/acmeuser/.acme.sh
[Sat Jul 10 01:14:18 CST 2021] default_acme_server='letsenctrypt'
[Sat Jul 10 01:14:18 CST 2021] ACME_DIRECTORY='letsenctrypt'
[Sat Jul 10 01:14:18 CST 2021] DOMAIN_PATH='/home/acmeuser/.acme.sh/stanworth.cloud'
[Sat Jul 10 01:14:18 CST 2021] Using ACME_DIRECTORY: letsenctrypt
[Sat Jul 10 01:14:18 CST 2021] _init api for server: letsenctrypt
[Sat Jul 10 01:14:18 CST 2021] GET
[Sat Jul 10 01:14:18 CST 2021] url='letsenctrypt'
[Sat Jul 10 01:14:18 CST 2021] timeout=
[Sat Jul 10 01:14:18 CST 2021] _CURL='curl --silent --dump-header /home/acmeuser/.acme.sh/http.header  -L  -g '
[Sat Jul 10 01:14:18 CST 2021] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 6
[Sat Jul 10 01:14:18 CST 2021] ret='6'
[Sat Jul 10 01:14:18 CST 2021] Can not init api for: letsenctrypt.
[Sat Jul 10 01:14:18 CST 2021] Sleep 10 and retry.

My web server is (include version): Nginx 1.21.1

The operating system my web server runs on is (include version): Ubuntu 18.04

I can login to a root shell on my machine (yes or no, or I don't know):
Yes

In the debug you will notice the misspelling of letsencrypt (letsenctrypt) -- I just cannot track down where this is hiding. I assume this is the root cause of the problem.

Any help would be appreciated!

That's an interesting typo there. I'm pretty sure something has been edited somewhere, maybe in acme.sh itself or maybe in a configuration file, but those two options should NOT be that value. Even without the typo.

And looking at the typo, these modifications were done manually?

Is there a configuration file present at /home/acmeuser/.acme.sh/ and what is its contents?

1 Like

You probably mis-typed

acme.sh --set-default-ca --server letsencrypt

at some point prior to issuing the cert. Simply redoing this command without the typo should fix it.

1 Like

Please show output of:
./acme.sh --version

Awsome!

Look what is hiding here in account.conf:

#LOG_FILE="/home/acmeuser/.acme.sh/acme.sh.log"
#LOG_LEVEL=1

#AUTO_UPGRADE="1"

#NO_TIMESTAMP=1


UPGRADE_HASH='a76dcd4ba1c6045794968bad38538afd1c9236ad'
DEFAULT_ACME_SERVER='letsenctrypt'

After the excitement subsides - I'm wondering why this has happened? Is this a typo on my part at some point?

Thanks. The version is v3.0.0

1 Like

I corrected the spelling of letsencrypt in the .conf - which still didn't work.
I also needed to reset the default ca.
Great things seems to be working! Thanks.

1 Like

remove the line in the conf .
And then acme.sh --set-default-ca --server letsencrypt

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.