Installation
https://certbot.eff.org/
#sudo apt-get install -y software-properties-common
#sudo add-apt-repository -y ppa:certbot/certbot
sudo apt-get update
sudo apt-get install -y certbot
# Install certbot package with Ansible:
https://github.com/panticz/ansible/tree/master/roles/certbot
Create certificate and configure nginx
certbot --nginx -d www.example.comcreate wildcard certificate
certbot certonly \
--manual \
--manual-public-ip-logging-ok \
--preferred-challenges dns-01 \
--register-unsafely-without-email \
--agree-tos \
--server https://acme-v02.api.letsencrypt.org/directory \
-d \*.example.comPack certificate
sudo tar --exclude=README -C /etc/letsencrypt/live -czhf /tmp/letsencrypt.tar.gz .Convert to p12
for DIR in $(find * -maxdepth 0 -type d); do
openssl pkcs12 -export -passout "pass:" -out "${DIR}/${DIR}.p12" -inkey "${DIR}/privkey1.pem" -in "${DIR}/cert1.pem" -certfile "${DIR}/chain1.pem"
doneForce renew certificate
sudo certbot renew --force-renewal
Docker
https://hub.docker.com/r/certbot/certbot/
# request wildcard certificate and store under /tmp
sudo docker run --rm -i -t -v /tmp:/etc/letsencrypt certbot/certbot certonly \
--manual --manual-public-ip-logging-ok --register-unsafely-without-email \
--agree-tos --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory \
-d \*.example.com
sudo ls -l /tmp/archive/example.com/
User guide
https://certbot.eff.org/docs/using.html
Flush cache
sudo systemd-resolve --flush-cachescheck TXT DNS entry
dig _acme-challenge.www.example.com TXT
#
# install
#
# Ubuntu Xenial package