TLS certificates
Keep HTTPS working on every SMS YANU host and reseller domain.
Every web address uses HTTPS. The full steps are in docs/TLS.md in the yanu-infra repo.
What is covered
- One Let's Encrypt certificate (named
smsyanu.com) covers smsyanu.com, www, app, auth, api, smpp and docs. - Each reseller domain gets its own certificate.
- SMPP on port 2775 is plain SMPP 3.4. It is protected by the IP allowlist, not by TLS.
How renewal works
- certbot's own timer (
certbot.timer) renews about 30 days before expiry. - After a renewal, a deploy hook reloads nginx so it uses the new certificate.
- The certificate authority emails expiry warnings to the address used at first issue. Use a mailbox Deltacomm reads.
Check expiry
On the server:
certbot certificates
systemctl list-timers certbot.timer
certbot renew --dry-runFrom any computer:
echo | openssl s_client -connect docs.smsyanu.com:443 -servername docs.smsyanu.com 2>/dev/null \
| openssl x509 -noout -enddateRepeat for each host. Under 14 days left means renewal is failing.
If renewal fails
- Check DNS still points the host to the server. If the host is behind the Cloudflare proxy, check the challenge on port 80 still reaches the server (start with "DNS only" if in doubt).
- Check port 80 is open on the server firewall. nginx serves
/.well-known/acme-challenge/from/var/www/certbot. - Look at
/var/log/letsencrypt/letsencrypt.log. - Fix the cause, run
certbot renew, thennginx -t && systemctl reload nginx.
Add a new SMS YANU host name
- Add it to the
nameslist inscripts/tls-issue.shin yanu-infra and run the script again. It expands the same certificate. - Add the nginx site, then
nginx -t && systemctl reload nginx.
New reseller domain
- The reseller points the domain at the server.
- Issue its certificate:
certbot certonly --webroot -w /var/www/certbot -d sms.partner.mw(use the real domain). - Add the nginx site from
nginx/sites/reseller-domain.conf.templatein yanu-infra and deploy it. - Add the reseller's theme for that domain. See Adding a reseller.