SSL for new accounts

jigster

Verified User
Joined
Jul 23, 2021
Messages
125
Since switching to the new Acme SSL certificate system, when a new account is added in DirectAdmin it doesn't provision a new SSL certificate straight away like it used to (used to take only 5-10 minutes). It says it takes up to 24 hours but we need it provisioned straight away otherwise users get errors when setting up email clients etc. Is there an API command to force the provision of a specific SSL certificate? Equivalent to clicking the 'Provision Now' button in the user DirectAdmin? Thanks.
 
Hello,

Is SSL enabled in your users' preferences? When I create a test user account on my side with a fake domain, I almost instantly get an email:

- New message: Error during automated certificate renewal for pxuser0003.localhost

that proves an immediate attempt to issue a certificate taken by DirectAdmin.

API:

POST /api/domain-tls/{domain}/provision-certs Provision certificates for domain

CLI:

Code:
da taskq --run 'action=rewrite&value=letsencrypt&domain=poralix.com'
 
Yes in /usr/local/directadmin/data/users/USER/user.conf: ssl=ON

Yet even waiting an hour, it doesn't provision. In the user DirectAdmin it says "New certificates are waiting to be provisioned." with a 'Provision Now' button. If I do that, the wildcards cert provisions straight away without any problems.

@zEitEr Does your system do the same immediate SSL provision with a real domain and a successful certificate provisioning?

What is *supposed* to happen (immediate for new accounts, or up to 24 hours)? Could anyone from DirectAdmin comment? If I know what is supposed to happen I can work from there :)
 
The ACME system is triggered in two ways:
  • An automatic periodic trigger that runs several times per day
  • User actions related to domain management
What you might be experiencing is this: when a user creates a domain, the ACME system is triggered within a minute, without waiting for DNS records to propagate. If the records aren’t ready yet, the attempt fails and will be retried on the next periodic run.

You can also trigger the ACME system manually, as @zEitEr suggested:
Bash:
# CLI, all domains
da taskq --run 'action=rewrite&value=letsencrypt'

# CLI, single domain
da taskq --run 'action=rewrite&value=letsencrypt&domain=example.com'

# API, single domain
curl -X POST "$(da api-url --user=bob)/api/domain-tls/example.com/provision-certs"

If you’d like to run the ACME system more often, you can experiment by manually setting up a cron job to trigger certificate provisioning, for example every hour:
Code:
0 * * * * da taskq --run 'action=rewrite&value=letsencrypt'

Note: as we continue to improve the ACME system with every release, issues like this will eventually be resolved.
 
Back
Top