Over a million developers have joined DZone.

How to Create a Wildcard Certificate Using Let's Encrypt Manually

DZone 's Guide to

How to Create a Wildcard Certificate Using Let's Encrypt Manually

Let's Encrypt is a free and popular service for generating security certificates that can help you add encryption protocols to your app.

· Security Zone ·
Free Resource

Let's Encrypt has become the number one choice of certificates since it is free and, although, it is short-lived, there is an abundance of tools out there making sure that your certificate will be updated on time.

This post will go through creating a wildcard Let's Encrypt certificate using the DNS challenge.
All you need is a registered domain name and the ability to add a txt DNS record.

I assume you have the latest version of certbot installed.

The first step is to issue the following: 

certbot certonly --server https://acme-v02.api.letsencrypt.org/directory --work-dir ./work-dir/ --config-dir ./config-dir --logs-dir ./logs-dir/ --manual --preferred-challenges dns -d *.{your domain name}

You will have some questions in the command prompt which you should answer.
Once you're done with that, you will end up with a screen asking you to take action and add a DNS txt record.

Please deploy a DNS TXT record under the name
_acme-challenge.{your domain} with the following value:

Once you put the entry into your DNS record, you need to wait until your txt record gets propagated.

One of the ways to check if it is ready is to use the nslookup method on another terminal.

nslookup -type=TXT _acme-challenge.{your domain}

This might take a while so feel free to use the watch command:

watch -n 1 nslookup -type=TXT _acme-challenge.{your domain}

Once that's done, you can press enter and your Let's Encrypt certificates shall be generated and this will be the result on your screen.

 - Congratulations! Your certificate and chain have been saved at:
   Your key file has been saved at:
   Your cert will expire on 2018-08-28. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

Now that you have your chain certificate and your private key, you are ready to use them for your applications.

security ,let's encrypt ,encryption certificate ,encryption ,dns

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}