Select Page

How To Issue And Auto-renew A Let’s Encrypt Wildcard Ssl Certificate With
Posted on December 18, 2019
How To Issue And Auto-renew A Let’s Encrypt Wildcard Ssl Certificate With

Jackie, also known by his nick-name KK, always strives for the best and learn from the best. Working and living as a Freelance Web Engineer/ Web Developer & Designer/ Amateur Youtuber/ Husky Lover. If you love one of these things that I love, we already have something in common.

Jackie Sung


Let's Encrypt is a non-profit certificate authority run by Internet Security Research Group (ISRG) that provides X.509 certificates for Transport Layer Security (TLS) encryption at no charge. The certificate is valid for 90 days, during which renewal can take place at any time. The offer is accompanied by an automated process designed to overcome manual creation, validation, signing, installation, and renewal of certificates for secure websites.

In this article we will see how to issue and auto-renew a wildcard SSL certificate with Cloudflare DNS API.

Step 1 - Install

wget -O - | sh

Step 2 - Issue a Wildcard SSL Certificate with Cloudflare DNS API

To add your Cloudflare API keys (available in your cloudflare dashboard > My Profile > API Tokens)

export CF_Key="your cloudflare api key"
export CF_Email="your cloudflare email" --issue -d -d * --dns dns_cf

If you want to use ECDSA certificate with 384 bits keys, you can do --issue -d -d * --dns dns_cf -k ec-384

You won't have to add DNS records or to run another command to issue your certificate. will automatically add the DNS records needed for the acme-challenge, then it will wait 120 seconds before launching the validation. If everything is okay, will issue your wildcard certificate and cleanup validation DNS records.

You shall see something like this

[email protected]: ~# --issue -d -d * --dns dns_cf -k ec-384
[jackiesung 2019, 14:58:08 (UTC+0100)] Multi domain=',DNS:*'
[jackiesung 2019, 14:58:08 (UTC+0100)] Getting domain auth token for each domain
[jackiesung 2019, 14:58:10 (UTC+0100)] Getting webroot for domain=''
[jackiesung 2019, 14:58:10 (UTC+0100)] Getting webroot for domain='*'
[jackiesung 2019, 14:58:10 (UTC+0100)] Found domain api file: /root/
[jackiesung 2019, 14:58:12 (UTC+0100)] Adding record
[jackiesung 2019, 14:58:12 (UTC+0100)] Added, OK
[jackiesung 2019, 14:58:12 (UTC+0100)] Sleep 120 seconds for the txt records to take effect
[jackiesung 2019, 15:00:14 (UTC+0100)] is already verified, skip dns-01.
[jackiesung 2019, 15:00:14 (UTC+0100)] Verifying:*
[jackiesung 2019, 15:00:17 (UTC+0100)] Pending
[jackiesung 2019, 15:00:19 (UTC+0100)] Success
[jackiesung 2019, 15:00:19 (UTC+0100)] Removing DNS records.
[jackiesung 2019, 15:00:20 (UTC+0100)] Verify finished, start to sign.
[jackiesung 2019, 15:00:22 (UTC+0100)] Cert success.
[jackiesung 2019, 15:00:22 (UTC+0100)] Your cert is in  /root/
[jackiesung 2019, 15:00:22 (UTC+0100)] Your cert key is in  /root/
[jackiesung 2019, 15:00:22 (UTC+0100)] The intermediate CA cert is in  /root/
[jackiesung 2019, 15:00:22 (UTC+0100)] And the full chain certs is there:  /root/

Step 3 - Install your wildcard certificate to your apache or nginx configuration

Apache --install-cert -d \
--cert-file      /path/to/certfile/in/apache/cert.pem  \
--key-file       /path/to/keyfile/in/apache/key.pem  \
--fullchain-file /path/to/fullchain/certfile/apache/fullchain.pem \
--reloadcmd     "service apache2 force-reload"

Nginx --install-cert -d \
--key-file       /path/to/keyfile/in/nginx/key.pem  \
--fullchain-file /path/to/fullchain/nginx/cert.pem \
--reloadcmd     "/etc/init.d/nginx restart"

Copyright Statement: Original Article of

Related Articles


Submit a Comment

Your email address will not be published. Required fields are marked *

Pin It on Pinterest

Share This