Translated from the Chinese original by Claude.
The Let’s Encrypt project aims to make getting SSL/TLS certificates quicker and easier, and free into the bargain. Let’s Encrypt is already trusted by IdenTrust, so it works on the vast majority of devices. The project went into public beta a couple of days ago, so let’s give it a try.
Here’s how my trial of Let’s Encrypt went
Update, 11 December 2015: letsencrypt has changed its domain validation rules. If your domain uses a Chinese DNS provider such as DNSPod or Cloudxns, it can’t be validated, because they don’t answer CAA queries, and you get the error DNS query timed out. DNSPod is working on a fix.
Installing the Let’s Encrypt client
Let’s Encrypt provides an automatic install script that you can simply download and run
1 2 3 | git clone https://github.com/letsencrypt/letsencrypt.git cd letsencrypt ./letsencrypt-auto |
For other ways to install it, see the user guide.
Getting a free domain certificate with Let’s Encrypt
The Let’s Encrypt client supports a number of ‘plugins’ for obtaining or installing certificates.
| Plugin | Obtain | Install | Notes |
|---|---|---|---|
| apache | Y | Y | Automatically obtains and installs a certificate on Debian-based distributions running Apache 2.4 with libaugeas0 1.0+ installed. |
| standalone | Y | N | Obtains a certificate using a standalone web server of its own. |
| webroot | Y | N | Obtains a certificate by writing to the webroot directory of an existing web server. |
| manual | Y | N | Helps you obtain a certificate by validating the domain yourself. |
| nginx | Y | Y | Still experimental, and not included in letsencrypt-auto. |
As I already had nginx installed, I chose the webroot plugin to get the certificate.
On the command line you need certonly and --webroot. You can also use --webroot-path or -w to give the web server’s root directory; --webroot-path /var/www/html and --webroot-path /usr/share/nginx/html, for example, are two common ones.
If you need a certificate for several domains at once, each domain uses the nearest --webroot-path before it, like this:
1 | ./letsencrypt-auto certonly --webroot -w /var/www/cfan.space/ -d www.cfan.space -d cfan.space -w /var/www/vmoe.info -d vmoe.info -d www.vmoe.info |
and a single certificate is issued for all of these domains.
Once the command runs, it asks whether you agree to the terms of service; just choose Agree.

If it succeeds, it tells you where the certificate is stored, when it expires and so on

The certificates are saved in /etc/letsencrypt/live/$domain, where you’ll find these files:
privkey.pem
The certificate’s private key
Warning:
this file must never be made public, at any time! Don’t give it to anyone, not even the Let’s Encrypt developers. Nor can you lock it away at the bottom of a drawer: the server still needs this file for SSL/TLS to work.
This is the file Apache wants as SSLCertificateKeyFile, and nginx as ssl_certificate_key.
cert.pem
The server certificate
This is Apache’s SSLCertificateFile.
chain.pem
All the certificates other than the server certificate, such as the root and intermediate certificates
This is Apache’s SSLCertificateChainFile.
fullchain.pem
All the certificates including the server certificate, i.e. cert.pem and chain.pem combined
This is nginx’s ssl_certificate.
Installing the certificate and turning on HTTPS
Edit the nginx configuration file of the domain the certificate was issued for and add configuration along these lines, and HTTPS will be used by default
1 2 3 4 5 | listen 443; listen [::]:443;#enables IPv6; delete this line if you have no IPv6 ssl on; ssl_certificate /etc/letsencrypt/live/www.cfan.space/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/www.cfan.space/privkey.pem; |
nginx 1.9.5 and later support HTTP/2, which can give performance a nice boost
1 2 3 4 | listen 443 ssl http2; listen [::]:443 ssl http2; ssl_certificate /etc/letsencrypt/live/www.cfan.space/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/www.cfan.space/privkey.pem; |
Save it and restart nginx, and that’s it.
Renewing the certificate
Renewing a Let’s Encrypt certificate is easy: just run the same letsencrypt-auto command you used to get it, with the –renew option added.
1 | ./letsencrypt-auto --renew certonly --webroot -w /var/www/cfan.space/ -d www.cfan.space -d cfan.space -w /var/www/vmoe.info -d vmoe.info -d www.vmoe.info |
To renew everything in one go, run the following command
1 | ./letsencrypt-auto renew |
Summary
A single simple command gets you a certificate. That’s partly because Let’s Encrypt issues domain-validated SSL certificates (DV), which only need proof that you own the domain; the free SSL certificates from startssl, comodo and, in China, WoSign were all domain certificates too.
Let’s Encrypt’s advantages over those earlier free certificates are pretty clear. For a start, it’s much simpler to use: with the bundled plugins you no longer have to generate the private key and the certificate signing request (CSR) by hand, and more plugins are planned to make things like installing the certificate automatic as well. The certificates are valid for a good deal less time than startssl’s one year, but because getting one is so easy, renewal can be automated. You can also choose your own key size, and so on.
All in all, getting a certificate validated is very easy, and it’s free and open source as well, so if you need one, why not give it a go.




