| name | ssl-tls-management |
| description | Use when setting up or renewing SSL/TLS certificates. Covers Let's Encrypt automation with certbot, ACM certificate requests, HSTS headers, OCSP stapling, mTLS for service-to-service auth, and certificate monitoring/rotation. |
| user-invocable | false |
| allowed-tools | ["Read","Write","Bash","Grep"] |
SSL/TLS Management
Let's Encrypt with Certbot
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com --non-interactive --agree-tos -m admin@example.com
sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials /etc/letsencrypt/cloudflare.ini \
-d "*.example.com" -d example.com --non-interactive --agree-tos
sudo certbot renew --dry-run
echo "0 0,12 * * * root certbot renew --quiet --deploy-hook 'systemctl reload nginx'" | sudo tee /etc/cron.d/certbot
ACME with Docker (Traefik)
services:
traefik:
image: traefik:v3
command:
- "--certificatesresolvers.letsencrypt.acme.email=admin@example.com"
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
- "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
ports:
- "443:443"
volumes:
- letsencrypt:/letsencrypt
Certificate Monitoring
echo | openssl s_client -servername example.com -connect example.com:443 2>/dev/null | openssl x509 -noout -dates
modules:
https_cert_check:
prober: http
http:
preferred_ip_protocol: ip4
fail_if_ssl: false
fail_if_not_ssl: true
Best Practices
- Automate renewal — Never let certificates expire manually
- HSTS — Enable with long max-age and includeSubDomains
- TLS 1.2+ — Disable TLS 1.0 and 1.1
- OCSP stapling — Enable for performance
- Monitor expiry — Alert 30 days before expiration
- CAA records — Restrict which CAs can issue for your domain
- Certificate transparency — Monitor CT logs for unauthorized issuance