SSL
An SSL certificate is needed for https. This SSL certificate is created with letsencrypt and certbot.
Create certificates
Because of wildcard certificate you need to verify ownership of the Domain. This is done with adding a TXT record to the DNS entry.
Automated DNS verification with hosttech API
The repository includes scripts to automate the DNS verification process using the hosttech API. These scripts will automatically add and remove the required TXT records for domain verification.
Setup
Make sure the scripts are executable:
chmod +x scripts/certbot-dns-hosttech-*.shEdit the configuration file to add your hosttech API token:
nano scripts/hosttech-config.shReplace
YOUR_HOSTTECH_API_TOKEN
with your actual API token from hosttech.You can also adjust the DNS propagation wait time (default is 60 seconds) if needed.
How it works
The
certbot-dns-hosttech-auth.sh
script is called by certbot to add the TXT record for verificationThe
certbot-dns-hosttech-cleanup.sh
script is called by certbot to remove the TXT record after verificationBoth scripts use the configuration in
hosttech-config.sh
With these scripts, certificate renewal can be automated, and you won't need to manually add DNS records. The files can be placed under /etc/letsencrypt/scripts
else the command has to be changed.
Result
The certificates are exported to /etc/letsencrypt
With the auth and cleanup hooks in place, the certificate can be renewed automatically using certbot's built-in renewal process:
You can also set up a cron job to automatically renew certificates when they're close to expiration:
Create pkcs12
Go into directory from result where .pem files are saved and execute following: