User login

Using LetsEncrypt (certbot via docker) for wildcard SSL certificates with CloudFlare

Using the latest wildcard support from LetsEncrypt may be a bit of a challenge, depending on your OS's current level of support, and your DNS servers/provider. Linked to this post is an example script that keeps all of certbot's data in it's own little separated directory hierarchy while using CloudFlare as the DNS provider.

Note that this does NOT have to run specifically on the server that you would like to use the certificate(s) on! As that was my usage scenario, upon a successful execution it will show suggested next steps for moving the certificate to your server and enabling it (in Apache).

If you do not yet have it, get docker first. Download the file, place it where you'd like to encapsulate your certificate acquisition files, unzip it and make it executable, and then run it. It will create a folder structure in the current directory that will ultimately house certbots housekeeping and logs - it is important to keep this data for renewal purposes (which hasn't been tested...yet).

Place a cf.ini file in the ./etc folder with contents (as per https://certbot-dns-cloudflare.readthedocs.io/en/latest/):

# Cloudflare API credentials used by Certbot
dns_cloudflare_email = youremail@example.com
dns_cloudflare_api_key = yourkeyBLABLAblaBLA

Additional reference pages:
https://certbot.eff.org/docs/install.html#running-with-docker
https://certbot.eff.org/docs/using.html#certbot-commands
https://docs.docker.com/engine/reference/run/

NOTE: This script is provided with NO WARRANTEE