Skip to content

15 min read

Free SSL certificate: Let's Encrypt and nginx

In one sentence: To have HTTPS with no warnings, your server needs a name and a certificate signed by an authority the browser knows. With a domain, Let's Encrypt gives you one for free: it checks over port 80 that the name points to your server, and certbot installs it in nginx and renews it on its own. With no domain, you sign the certificate yourself with your own authority, and only your computer trusts it.

What you will learn

  • Point a domain to your server with A and AAAA records, and know what its TTL does.
  • Explain how Let's Encrypt checks that the domain is yours, and why it needs port 80.
  • Create your own certificate authority with openssl, sign the shop's certificate with it and install it in nginx.
  • Read a certificate's chain with openssl s_client, and understand the browser's warning.

Before you start, read: 04-reverse-proxy.md

At the end of lesson 4, the shop answers over HTTPS, but only with curl -k, which skips the certificate check. Marta opens the address in her browser and sees a red screen: “Your connection is not private.” She isn’t going to buy there.

The provisional certificate claims to be for shop.example, a name that doesn’t point to your server, and nobody the browser knows signed it. Two things are missing: a real name and a signature to trust.

The analogy

Think of opening a shop on a street. First, an address that shows up on the maps: the domain. Then, a seal on the door from a body everyone knows: “these premises belong to who they say.”

That body, Let’s Encrypt, doesn’t ask you for papers: it gives you a code and comes by to see whether you’ve put it in the window. If it’s there, you control the premises.

With no address on the maps, like your virtual machine, you make your own seal. It’s valid at home, where they know it; a stranger has no reason to believe it.

Where the analogy breaks down

  • The body doesn’t check who you are or whether your shop is honest: only that you control the address. A scam website can have a padlock too.
  • A shop’s seal lasts for years. A Let’s Encrypt certificate lasts 90 days, and a program renews it without you noticing.

A Domain nameThe name of a website or a server, such as example.com, which you buy by the year from a registrar. Whoever holds it decides, with its DNS records, which IP address it points to.Go to definition, like shop.example, is bought by the year from a registrar: Cloudflare Registrar, Porkbun or Namecheap, for example. Prices change: on October 17, 2026, a .com cost $11.08 a year at Porkbun.

From its dashboard you decide where it points, with the DNS recordDNS stands for Domain Name System.A piece of data a domain publishes in the DNS, with a type: A (an IPv4 address), AAAA (an IPv6 address), CNAME (an alias for another name), MX (the mail server), TXT (free text) or NS (its DNS servers).Go to definition you saw in Phase 0:

Name Type Value TTL
shop.example A 203.0.113.10, your server’s IPv4 300
shop.example AAAA 2001:db8::10, its IPv6, if it has one 300

The TTL (in DNS)TTL stands for time to live.The number of seconds a DNS answer may be kept in a cache before asking again. It has nothing to do with the TTL of IP packets, which counts how many routers they may go through.Go to definition is the number of seconds each cache can keep the answer. While you’re setting up the server, keep it low (300, five minutes): if you get the IP wrong, the fix arrives soon. It’s the false “propagation” from Phase 0.

How Let’s Encrypt knows the domain is yours

Section titled “How Let’s Encrypt knows the domain is yours”

Let’s EncryptA nonprofit certificate authority that gives out certificates for free and automatically. Before signing one, it checks with the ACME protocol that whoever asks for it controls the domain.Go to definition is the free, automatic certificate authority we promised you in Phase 0. It talks to a program on your server, certbot, through a protocol, ACMEACME stands for Automatic Certificate Management Environment.The protocol a program on your server, such as certbot, uses to ask a certificate authority like Let’s Encrypt for a certificate, prove that it controls the domain (for example, by publishing a file on port 80) and renew it without you stepping in.Go to definition. The most common check is called HTTP-01:

  1. certbot (your server) → Let's EncryptI want a certificate for shop.example
  2. Let's Encrypt → certbot (your server)Publish this answer for the token TOKEN
  3. certbot (your server) → nginx, port 80 (your server)Puts it at /.well-known/acme-challenge/TOKEN
  4. certbot (your server) → Let's EncryptDone, check it
  5. Let's Encrypt → nginx, port 80 (your server)GET http://shop.example/.well-known/acme-challenge/TOKEN
  6. nginx, port 80 (your server) → Let's EncryptThe answer
  7. certbot (your server) → Let's EncryptMy CSR
  8. Let's Encrypt → certbot (your server)The certificate, signed

Let’s Encrypt asks for the file from the internet: if it gets it, whoever asks for the certificate controls the name’s server. And it always starts on port 80, over http. Let’s Encrypt’s documentation puts it like this: “The HTTP-01 challenge can only be done on port 80.”

That’s why the shop’s site leaves that path out of the redirect:

nginx/shop.conf
# Port 80: everything is redirected to HTTPS, except the challenge Let's Encrypt uses to check that
# the domain is yours (certbot answers it; lesson 5).
server {
listen 80;
listen [::]:80;
server_name shop.example;
location /.well-known/acme-challenge/ {
root /var/www/html;
}
location / {
return 301 https://$host$request_uri;
}
}

Whatever asks for /.well-known/acme-challenge/ is looked up in /var/www/html; everything else is redirected. That way the challenge doesn’t depend on 443. While it lasts, certbot also adds its own answer, and removes it when it’s done.

The CSRCSR stands for Certificate Signing Request.The request sent to a certificate authority for it to sign a certificate. It carries the server’s public key and the names it must cover, signed with its private key, which never leaves the server.Go to definition (Certificate Signing Request) is the request for a signature: your public key and the names the certificate must cover. The private key never leaves your server.

With sudo certbot --nginx -d shop.example, certbot does all of that and also changes your nginx site. It looks for the block with server_name shop.example and replaces the two certificate lines with Let’s Encrypt’s, which the file already has commented out:

nginx/shop.conf
# Port 443: HTTPS, and the shop behind (the block goes on: what follows is inside it).
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name shop.example;
# The server's certificate and its key. In lesson 4, a provisional self-signed one (curl -k);
# lesson 5 replaces it with one signed by your own certificate authority (openssl). That way it
# works without a domain: the browser warns because it doesn't know that authority, and curl
# --cacert accepts it.
ssl_certificate /etc/ssl/shop/shop.crt;
ssl_certificate_key /etc/ssl/shop/shop.key;
# With a domain and Let's Encrypt, certbot --nginx replaces the two lines above with these (or
# you replace them), with your domain's name in the folder:
# ssl_certificate /etc/letsencrypt/live/shop.example/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/shop.example/privkey.pem;
  • fullchain.pem: your certificate and, behind it, the one of the intermediate authority that signed it. The browser needs both to reach a root on its list.
  • privkey.pem: the private key, which only root reads.

Let’s Encrypt’s certificates last 90 days in October 2026, and will go down to 64 in February 2027 and to 45 in 2028, according to its schedule. Nobody renews them by hand: certbot installs a systemd timer that tries twice a day and only renews the ones that expire soon.

Your VM has a Private IP addressIP stands for Internet Protocol.An IP address that only works inside a local network, such as 192.168.1.133. The same ones are reused in millions of homes, and they can’t be reached from the internet.Go to definition: nobody on the internet can reach it. We tried it on the VM the outputs come from, with certbot certonly --dry-run, which uses Let’s Encrypt’s test servers: it doesn’t save a certificate, but it registers a test account there:

Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems:
Identifier: 192-168-5-15.sslip.io
Type: dns
Detail: no valid A records found for 192-168-5-15.sslip.io; no valid AAAA records found for 192-168-5-15.sslip.io

It doesn’t even try: the name points to a private address, and Let’s Encrypt discards it.

Without a domain: sslip.io and your own authority

Section titled “Without a domain: sslip.io and your own authority”

For the VM, two free pieces:

  • A name: sslip.io is a public DNS server that answers with the IP written in the name: 192-168-5-15.sslip.io is 192.168.5.15. Some home routers discard public DNS answers with private IPs (the protection against DNS rebinding: an attack in which a website switches its IP to one on your network so your browser talks to your devices). If it happens to you, plan B is your computer’s hosts file.
  • An authority: with openssl you create a certificate authority, your own, that signs the shop’s certificate. Your computer trusts what it signs if you give it its certificate; Marta’s browser doesn’t.

And lesson 4’s self-signed one? You’d have to hand out every server’s certificate. With an authority, you trust it once and it’s valid for everything it signs, as with the real ones.

With the good certificate, two things that were already there start to work:

  • The redirect. Whoever types http:// gets a 301 to the same address with https://: port 80’s return 301.
  • strict-transport-security, the HSTSHSTS stands for HTTP Strict Transport Security.The Strict-Transport-Security header, with which a site asks the browser to connect to it only over HTTPS for as long as it says, even if you type http:// or follow an old link. The browser only takes it into account if it arrives over HTTPS.Go to definition header the API has sent since Phase 6. We told you it would act with HTTPS: the browser only pays attention to it if it arrives with a valid certificate. From then on, for max-age=15552000 seconds (180 days), it goes straight to https://.

The goal: get your computer to talk to the shop over HTTPS without -k, read the certificate’s chain and see what the browser says. Already have a domain and a VPS? Go to With a domain: Let’s Encrypt.

The outputs are from lesson 4’s VM, 192.168.5.15, and from another machine playing your computer. Use your IP with dashes: with 192.168.64.2, your name is 192-168-64-2.sslip.io. Your dates and times will be different.

On the server, ask a public DNS, Cloudflare’s (1.1.1.1), for the name:

1. sslip.io's A record

Ventana de terminal
dig +noall +answer 192-168-5-15.sslip.io @1.1.1.1

What you will see:

192-168-5-15.sslip.io. 3600 IN A 192.168.5.15

An A record with your IP and a TTL of 3600 seconds. Nobody registered that name: sslip.io reads it and answers.

Now on your computer, with your network’s DNS:

2. From your computer

Ventana de terminal
dig +short 192-168-5-15.sslip.io

What you will see:

192.168.5.15

If your IP comes out, go on. If nothing comes out, your router is discarding the answer: go to plan B. On Windows, nslookup 192-168-5-15.sslip.io, which prints more lines.

Plan B: the hosts file

Ventana de terminal
echo "192.168.5.15 192-168-5-15.sslip.io" | sudo tee -a /etc/hosts

What you will see:

192.168.5.15 192-168-5-15.sslip.io

Only if step 2 gave nothing. Your computer looks at hosts before asking the DNS, so the name works all the same. It needs administrator permissions: on Windows, open PowerShell with “Run as administrator.” Delete that line when you finish the phase.

Your authority and the shop’s certificate

Section titled “Your authority and the shop’s certificate”

On the server, create the authority in a folder of its own:

3. The authority

Ventana de terminal
mkdir ~/authority && cd ~/authority
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes -days 365 -subj "/CN=Ana's shop authority" -keyout ca.key -out ca.crt
ls -l

What you will see:

-----
total 8
-rw-rw-r-- 1 ubuntu ubuntu 607 Oct 18 02:24 ca.crt
-rw------- 1 ubuntu ubuntu 241 Oct 18 02:24 ca.key

The provisional certificate’s command, with another name and a year of life. ca.key is the key that signs: -rw-------, for you only. ca.crt is the authority’s certificate, the one you’ll hand out.

4. What makes it an authority?

Ventana de terminal
openssl x509 -in ca.crt -noout -subject -issuer -dates -ext basicConstraints

What you will see:

subject=CN=Ana's shop authority
issuer=CN=Ana's shop authority
notBefore=Oct 18 00:24:13 2026 GMT
notAfter=Oct 18 00:24:13 2027 GMT
X509v3 Basic Constraints: critical
CA:TRUE
  • subject and issuer the same: it signs itself. It’s a root, like the ones your system comes with.
  • CA:TRUE: it can sign other certificates.

Now the shop’s key and its CSR, with the name:

5. The shop's key and its CSR

Ventana de terminal
openssl req -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -nodes -subj "/CN=192-168-5-15.sslip.io" -addext "subjectAltName=DNS:192-168-5-15.sslip.io" -addext "extendedKeyUsage=serverAuth" -keyout shop.key -out shop.csr
openssl req -in shop.csr -noout -subject -verify

What you will see:

-----
Certificate request self-signature verify OK
subject=CN=192-168-5-15.sslip.io

Without -x509, openssl req makes a request instead of a certificate.

  • subjectAltName: where browsers look for the name; only old programs look at CN.
  • extendedKeyUsage=serverAuth: what the certificate is for, identifying a server. macOS and Safari require it on server certificates, and tools like mkcert always add it.
  • -verify: checks that the CSR is signed with shop.key.

6. Your authority signs it

Ventana de terminal
openssl x509 -req -in shop.csr -CA ca.crt -CAkey ca.key -days 90 -copy_extensions copy -out shop.crt
openssl x509 -in shop.crt -noout -subject -issuer -dates -ext subjectAltName,extendedKeyUsage

What you will see:

Certificate request self-signature ok
subject=CN=192-168-5-15.sslip.io
subject=CN=192-168-5-15.sslip.io
issuer=CN=Ana's shop authority
notBefore=Oct 18 00:24:13 2026 GMT
notAfter=Jan 16 00:24:13 2027 GMT
X509v3 Subject Alternative Name:
DNS:192-168-5-15.sslip.io
X509v3 Extended Key Usage:
TLS Web Server Authentication
  • -CA and -CAkey: sign with your authority. -copy_extensions copy carries the CSR’s extensions over to the certificate: the name and the usage.
  • issuer is now your authority, and it expires in 90 days, like a Let’s Encrypt one.

Copy it where nginx looks for it, over the provisional one:

7. To /etc/ssl/shop

Ventana de terminal
sudo cp shop.crt shop.key /etc/ssl/shop/
sudo ls -l /etc/ssl/shop

What you will see:

total 8
-rw-r--r-- 1 root root 660 Oct 18 02:24 shop.crt
-rw------- 1 root root 241 Oct 18 02:24 shop.key

The key, -rw-------: for root only. ca.key isn’t copied, because nginx doesn’t need it; and it shouldn’t stay on the server longer than necessary: you’ll delete it before you trust your authority.

Go back to /opt/shop and put your name in the two server_name lines:

8. The name in the site

Ventana de terminal
sed -i 's/server_name shop.example;/server_name 192-168-5-15.sslip.io;/' nginx/shop.conf
grep -n "server_name" nginx/shop.conf

What you will see:

9:# 1. shop.example, in the two server_name lines, to your name: your domain or, with the free
41: server_name 192-168-5-15.sslip.io;
59: server_name 192-168-5-15.sslip.io;

sed -i changes the file. Line 9 is a comment; 41 and 59, the two server blocks.

9. Install it and reload

Ventana de terminal
sudo cp nginx/shop.conf /etc/nginx/sites-available/shop
sudo nginx -t && sudo systemctl reload nginx

What you will see:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

If nginx -t says key values mismatch, you copied the key of one certificate and the certificate of another: repeat step 7.

The shop only accepts requests with the session cookie from its own websites, ALLOWED_ORIGINS (Phase 6). Now it has a different name:

10. The shop's origin

Ventana de terminal
sed -i 's|^ALLOWED_ORIGINS=.*|ALLOWED_ORIGINS=https://192-168-5-15.sslip.io|' .env
grep ^ALLOWED_ORIGINS .env
docker compose -f compose.production.yaml up -d api

What you will see:

ALLOWED_ORIGINS=https://192-168-5-15.sslip.io
…
[+] up 4/4
…
✔ Container shop-api-1 Started 1.9s
✔ Container shop-migrate-1 Exited 1.1s

up -d api recreates the API so it reads the new .env. Wait a few seconds before the next step: while it starts, nginx answers 502.

On your computer, without -k:

11. Without your authority

Ventana de terminal
curl https://192-168-5-15.sslip.io/health

What you will see:

curl: (60) SSL certificate OpenSSL verify result: unable to get local issuer certificate (20)
More details here: https://curl.se/docs/sslcerts.html
…

The name matches now; what fails is the signature: unable to get local issuer certificate, it can’t find whoever signed it on your system. The text changes depending on your system.

Bring over the authority’s certificate, never its key, and give it to curl:

12. With your authority

Ventana de terminal
scp ubuntu@192.168.5.15:authority/ca.crt .
curl --cacert ca.crt -i https://192-168-5-15.sslip.io/health

What you will see:

ca.crt 100% 607 2.2MB/s 00:00
HTTP/2 200
server: nginx/1.28.3 (Ubuntu)
…
strict-transport-security: max-age=15552000; includeSubDomains
…
x-xss-protection: 0
{"status":"ok"}

HTTP/2 200 without -k: curl has checked the chain up to your authority, and the name. It’s the HTTPS Phase 2 promised your VM’s nginx, and with it, HTTP/2. And there’s strict-transport-security: max-age is 180 days, and includeSubDomains extends the rule to every name that ends in yours.

On Windows, --ssl-no-revoke: curl.exe asks whether the certificate has been revoked, and your authority doesn’t publish that list.

13. Over http

Ventana de terminal
curl -i http://192-168-5-15.sslip.io/health

What you will see:

HTTP/1.1 301 Moved Permanently
Server: nginx/1.28.3 (Ubuntu)
…
Location: https://192-168-5-15.sslip.io/health
…

The 301, now to a name with a valid certificate.

openssl s_client is a TLS client: it connects and tells you what it sees. On the server:

14. The chain

Ventana de terminal
openssl s_client -connect 192-168-5-15.sslip.io:443 -servername 192-168-5-15.sslip.io -CAfile ~/authority/ca.crt < /dev/null

What you will see:

Connecting to 192.168.5.15
CONNECTED(00000003)
depth=1 CN=Ana's shop authority
verify return:1
depth=0 CN=192-168-5-15.sslip.io
verify return:1
---
Certificate chain
0 s:CN=192-168-5-15.sslip.io
i:CN=Ana's shop authority
a:PKEY: EC, (prime256v1); sigalg: ecdsa-with-SHA256
v:NotBefore: Oct 18 00:24:13 2026 GMT; NotAfter: Jan 16 00:24:13 2027 GMT
---
…
Verification: OK
…
Verify return code: 0 (ok)
…
  • -servername: the name that goes in the SNI, so nginx picks the certificate (Phase 0). < /dev/null closes the connection when it’s done.
  • depth=1 and depth=0: the check, from the root (your authority) to the shop.
  • Certificate chain: what nginx sends, a single certificate. s: is whose it is; i:, who signed it. With Let’s Encrypt you’d see two: yours and the intermediate’s, the fullchain.pem.

15. Without -CAfile

Ventana de terminal
openssl s_client -connect 192-168-5-15.sslip.io:443 -servername 192-168-5-15.sslip.io < /dev/null 2>&1 | grep -E "depth|verify|Verify return code"

What you will see:

depth=0 CN=192-168-5-15.sslip.io
verify error:num=20:unable to get local issuer certificate
…
Verify return code: 21 (unable to verify the first certificate)

curl’s error 20 from step 11.

Open https://192-168-5-15.sslip.io/health in your computer’s browser. We did it with Chromium 153, the base of Chrome and Edge, in English:

Your connection is not private
Attackers might be trying to steal your information from 192-168-5-15.sslip.io (for example, passwords, messages, or credit cards). Learn more about this warning
NET::ERR_CERT_AUTHORITY_INVALID
Back to safety
Advanced

ERR_CERT_AUTHORITY_INVALID: the authority isn’t on its list. It’s the first of the three checks from Phase 0; the name and the dates are fine. When you press “Advanced”:

This server could not prove that it is 192-168-5-15.sslip.io; its security certificate is not trusted by your computer's operating system. This may be caused by a misconfiguration or an attacker intercepting your connection.
Proceed to 192-168-5-15.sslip.io (unsafe)

Firefox and Safari word it differently. If you go in with “Proceed,” the connection is encrypted, but the browser ignores the HSTS header: it doesn’t come from a valid certificate.

To get the padlock, add ca.crt to your computer’s authorities. On macOS, double-clicking it adds it to Keychain Access: open it there and, under “Trust,” choose “Always Trust.” On Windows, double-click it, “Install Certificate” and the “Trusted Root Certification Authorities” store. Firefox can use its own list, in its certificate settings.

Think it over first: your computer will trust any certificate ca.key signs, for any name, your-bank.example included. Whoever has that key could pass themselves off as any website to you. Before you trust it, delete ca.key on the server: it has already signed the certificate, and for another one you’ll make another authority.

Delete the authority's key

Ventana de terminal
rm ~/authority/ca.key
ls -l ~/authority

What you will see:

total 16
-rw-rw-r-- 1 ubuntu ubuntu 607 Oct 18 02:24 ca.crt
-rw-rw-r-- 1 ubuntu ubuntu 660 Oct 18 02:24 shop.crt
-rw-rw-r-- 1 ubuntu ubuntu 473 Oct 18 02:24 shop.csr
-rw------- 1 ubuntu ubuntu 241 Oct 18 02:24 shop.key

Without ca.key, nobody signs anything else with your authority. When you finish the phase, remove your computer’s trust in it, where you added it, and delete ca.crt if you like. If Chrome has already seen the HSTS header, delete it at chrome://net-internals/#hsts, with “Delete domain security policies” and your name.

On a VPS with a domain, steps 3 to 7 and the browser’s warning go away: Let’s Encrypt does them. Before you start, check on your server that 80 lets the challenge through. It works the same on the VM:

16. A test challenge

Ventana de terminal
sudo mkdir -p /var/www/html/.well-known/acme-challenge
echo "challenge-test" | sudo tee /var/www/html/.well-known/acme-challenge/test

What you will see:

challenge-test

A file where Let’s Encrypt would look for it.

17. What Let's Encrypt would see

Ventana de terminal
curl -i http://192-168-5-15.sslip.io/.well-known/acme-challenge/test

What you will see:

HTTP/1.1 200 OK
Server: nginx/1.28.3 (Ubuntu)
…
challenge-test

From your computer: 200, not 301. On the server, delete it with sudo rm -r /var/www/html/.well-known.

And the steps, on your VPS:

  1. Buy the domain from a registrar and create the A record with your server’s IP, and the AAAA one if it has IPv6, with TTL 300. Check it from your computer with dig +short shop.example.

  2. Open 80 and 443 in ufw (lesson 2) and in the provider’s firewall.

  3. Put your domain in the two server_name lines and in ALLOWED_ORIGINS, as in steps 8 to 10.

  4. Install certbot. In October 2026, its instructions recommend the snap package. If you have the apt one, remove it first (sudo apt remove certbot).

18. certbot, as a snap

Ventana de terminal
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/local/bin/certbot
certbot --version

What you will see:

…
certbot 5.8.0 from Certbot Project (certbot-eff✓) installed
certbot 5.8.0

ln -s creates a link so the certbot command can be found. Captured on the VM: your version may be newer.

  1. Ask for the certificate: first, as a test, sudo certbot certonly --nginx --dry-run -d shop.example: if it fails, it doesn’t use up Let’s Encrypt’s limits. Then, sudo certbot --nginx -d shop.example. The first time it asks you for an email and to accept the terms; it does the challenge, changes the two ssl_certificate lines of your site and reloads nginx. If you copy shop.conf again, change those two lines yourself: they’re commented out in the file.

  2. Test the renewal: sudo certbot renew --dry-run simulates it against the test servers.

  3. Open https://shop.example in the browser: now, at last, the padlock.

The renewal is launched by a systemd timer the snap installs:

19. certbot's timer

Ventana de terminal
systemctl cat snap.certbot.renew.timer

What you will see:

/etc/systemd/system/snap.certbot.renew.timer
…
[Timer]
Unit=snap.certbot.renew.service
OnCalendar=*-*-* 01:12
OnCalendar=*-*-* 20:03
…

Twice a day. certbot looks at each certificate and only renews the ones close to expiring: the rest of the days, it does nothing.

With your domain and HTTPS you can now offer “Sign in with Google”: Google requires an https:// callback URL on a domain of yours, not an IP or sslip.io. The steps are in Phase 6: you register https://shop.example/v2/session/provider/callback and remove the # from the four OIDC_* lines of .env.

  • This website’s padlock. Its certificate is signed by Google Trust Services, valid for 90 days (from October 9, 2026 to January 7, 2027), and covers backenddesdecero.com and *.backenddesdecero.com. Cloudflare, which serves the site, requests and renews it without us doing anything.
  • Closing 80 “because everything goes over HTTPS now.” The renewal fails silently and the certificate expires weeks later.
  • An AAAA that points somewhere else. If it exists, Let’s Encrypt tries IPv6 first (its documentation). If your server doesn’t have IPv6, don’t create the record.
  • Asking for the certificate before the DNS points to the server. Let’s Encrypt sees the old IP, and retrying many times runs into its limits.
  • Going in by the IP with a certificate that only has the name. curl says no alternative certificate subject name matches target ipv4 address: the URL’s name has to be in subjectAltName.
  • Copying or sharing ca.key. With it, anyone can sign any name your computer will accept.
  • Trying HTTPS with your domain and going back to http. Whoever saw HSTS won’t be able to get in over http for 180 days, on any subdomain either (includeSubDomains). Test with a subdomain, like shop.yourdomain.com.
  • Removing the authority after the browser saw HSTS. For 180 days it won’t let you “Proceed” past the warning, unless you delete the rule.
  • A domain is bought by the year; its A and AAAA records point to your server, and the TTL says how long a change takes to show.
  • Let’s Encrypt checks that the domain is yours by asking for a file over port 80 from the internet. certbot does it all and renews on its own.
  • No public IP, no Let’s Encrypt. With sslip.io and your own authority you have real HTTPS on your computer, and a warning on any other.
  • With a valid certificate, the redirect to https and the HSTS header start protecting.
You close port 80 in ufw because the shop already goes entirely over HTTPS. Three months later, the certificate has expired. What happened?

With your own authority, curl --cacert ca.crt works, but Marta opens the shop from her phone and sees NET::ERR_CERT_AUTHORITY_INVALID. Why?

You change your domain’s A record to a new server. An hour later, some people still reach the old one. What’s going on?

For your authority to sign the shop’s certificate, what do you have to give it?

curl --cacert ca.crt https://192.168.5.15/health fails, even though it works with the sslip.io name. Why?

Marta visited your shop, with its Let’s Encrypt certificate, a week ago. Today she types http://shop.example. What happens?

phase-8 · lesson 5/8