TenanciTenanci

Help centerProjects, domains & DNS

HTTPS certificates

How Tenanci issues and renews the HTTPS certificate of every domain on its own, what can get in the way (CAA, IPv6, proxies) and how to fix it.

Every domain you connect to Tenanci gets HTTPS automatically: the certificate is issued as soon as DNS points to us and renewed before it expires, so neither you nor your customer has to buy, install or remember anything. Visitors see the padlock on the customer's domain from the very first visit.

How it works

After you add a domain it goes through three stages, shown in the domain's Timeline on the DNS tab:

Status What's happening
Waiting for DNS Waiting for the DNS record to point to Tenanci (see DNS)
Issuing certificate DNS found; the HTTPS certificate is being issued (usually 1 to 2 minutes)
Active Live, with HTTPS

The domain only starts answering once the certificate is ready, so nobody ever sees a "not secure" warning along the way. From then on, anyone typing http:// is sent to https:// automatically.

HTTP-01 and DNS-01 validation

To issue a certificate, the certificate authority has to confirm that the domain points to whoever asked for it. There are two ways to do that:

  • HTTP-01 (what Tenanci uses for your customers' domains): the authority fetches a temporary address at http://customer-domain/.well-known/acme-challenge/... and Tenanci answers it. All it takes is a correct CNAME or A record; there's nothing else to create;
  • DNS-01: the check is done through an _acme-challenge TXT record. It's only used for wildcard certificates (*.domain.com) on Tenanci's own addresses. You don't need to create that record.

Automatic renewal

Certificates are valid for a few months, and Tenanci renews each one by itself close to expiry (in the window the certificate authority recommends or, without one, in the last third of its validity). The new certificate only replaces the old one after it has been issued: renewal never takes the domain offline.

For renewal to work, the domain's DNS must keep pointing to Tenanci. If the customer changes DNS or switches providers, they need to recreate the record.

CAA records

A CAA record says which authorities may issue certificates for a domain. Most domains have none, in which case any authority can. If the customer's domain does have CAA records, they must allow Let's Encrypt, which issues Tenanci's certificates; otherwise issuance is refused.

Ask the customer to add this to the main domain (e.g. mariasschool.com):

Type: CAA
Name: @
Value: 0 issue "letsencrypt.org"

When something goes wrong

If issuance fails, Tenanci retries on its own at growing intervals (5 minutes, 30 minutes, 2 hours, 6 hours). Once the attempts run out, the domain goes to Error and the reason shows up on the DNS tab: Certificate issuance failed (with the detail returned by the authority) or Timed out issuing the certificate. The organization's owners and admins get an email, and the domain.status_changed event is sent to your webhooks.

The most common causes:

Symptom What to do
CAA records that don't include Let's Encrypt Add 0 issue "letsencrypt.org" (see CAA records)
The domain has an AAAA (IPv6) record pointing to another server The authority tries IPv6 and never reaches Tenanci. Delete the domain's AAAA records
Cloudflare proxy on (orange cloud) Switch it to "DNS only"
DNS changed right after it was created Wait for propagation and try again
Many attempts in a row for the same domain The authority rate-limits repeated requests; wait a few hours before trying again

Once the cause is fixed, open the domain, go to the DNS tab and click Check again: Tenanci checks DNS once more and issues the certificate again. If the error persists, contact support through Report a problem in the menu.

Via the API

Status and reason are in GET /domains/:id (status, statusReason); the history is in GET /domains/:id/events. To retry after fixing DNS, call POST /domains/:id/recheck.

curl https://api.tenanci.com/v2/domains/dom_4h7n1q -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"
# → { "status": "error", "statusReason": "cert_failed: ...", ... }
curl -X POST https://api.tenanci.com/v2/domains/dom_4h7n1q/recheck -H "Authorization: Bearer tnc_live_xxxxxxxx_xxxxxxxxxxxx"

Removing a domain

When you delete a domain, it goes offline and its certificate is revoked. If the same address is registered again later, a new certificate is issued as usual.