Your DevOps study space

Real explanations. Videos with tests. Fresh exams every time. Keep the streak alive and watch the XP stack up.

TLS, HTTPS & certificates · Networking Docs · StackwisePlanDevOps TLS, HTTPS & certificates · Networking Docs · StackwiseCodePython TLS, HTTPS & certificates · Networking Docs · StackwiseBuildDocker TLS, HTTPS & certificates · Networking Docs · StackwiseTestDevOps TLS, HTTPS & certificates · Networking Docs · StackwiseReleaseGit TLS, HTTPS & certificates · Networking Docs · StackwiseDeployKubernetes TLS, HTTPS & certificates · Networking Docs · StackwiseOperateLinux TLS, HTTPS & certificates · Networking Docs · StackwiseMonitorDevOps

Pick a topic

Eight tracks, each with docs, a cheat sheet, videos and tests.

How it works

One loop, repeated until it sticks.

Jump back in

Picked up from where you left off.

Free forever

Your DevOps journey starts with one click.

Sign in with Google or GitHub to open every chapter, video, test and challenge. Your progress is saved wherever you learn.

TLS, HTTPS & certificates

The HTTP chapter said HTTPS is "HTTP inside TLS". This chapter opens that box: what TLS protects, what happens in the handshake, how certificates prove who a server is, how to get free ones from Let's Encrypt, and how to debug the certificate errors you will definitely run into.

What TLS gives you

  • Confidentiality: traffic is encrypted, so Wi-Fi owners and ISPs see only scrambled bytes. They can still see which server you connect to, just not what you send.
  • Integrity: every record carries a cryptographic check; if a byte is changed in transit, the connection fails.
  • Authentication: the server proves it really is demee.cc with a certificate a trusted authority signed. Without this, you could be talking, very privately, to an attacker.

"SSL" is the old name. SSL and TLS 1.0/1.1 are deprecated and disabled in modern browsers; allow only TLS 1.2 and 1.3. "SSL certificate" and "TLS certificate" mean the same thing.

The handshake (TLS 1.3)

  1. ClientHello: the client lists the versions and ciphers it supports, sends its half of a key exchange (a key share), and names the site it wants in the SNI field. SNI is how one IP address can serve many HTTPS sites with different certificates.
  2. ServerHello: the server picks a cipher and sends its own key share. Both sides combine the shares (an ECDHE exchange, commonly X25519) into the same secret, which never crossed the wire. Everything after this is encrypted.
  3. Certificate + CertificateVerify: the server sends its certificate chain and a signature over the handshake made with the certificate's private key, proving it owns that certificate.
  4. Finished: the client checks the certificate (trusted chain, right hostname, not expired), both sides confirm the handshake wasn't tampered with, and the HTTP request goes out encrypted with fast symmetric keys (AES-GCM or ChaCha20-Poly1305).

TLS 1.3 needs one round trip for this, TLS 1.2 needed two. Because session keys come from throwaway key shares, stealing the server's private key later doesn't decrypt recorded traffic: forward secrecy.

Certificates, chains and CAs

A certificate (X.509, usually a .pem text file) binds a public key to names. What matters in it:

  • Subject Alternative Name (SAN): the hostnames it's valid for. Browsers check this list, not the old Common Name. A wildcard *.demee.cc covers study.demee.cc but not demee.cc or a.b.demee.cc.
  • Issuer, validity (notBefore/notAfter), the public key, and the issuer's signature over all of it.

Trust works as a chain: your leaf certificate is signed by an intermediate, which is signed by a root. Roots come pre-installed in the OS and browser (the trust store; on Ubuntu, the ca-certificates package). The server must send the leaf and the intermediates. Forgetting the intermediate is a classic mistake: browsers often cope, but curl, scripts and phones fail.

A Certificate Authority (CA) checks that you control a domain before signing. Industry rules keep cutting lifetimes: since 15 March 2026 a public certificate can be valid for at most 200 days, dropping to 100 days in 2027 and 47 days in 2029. Renewal has to be automated.

root CAin your OS / browserthe server sends both (fullchain.pem)intermediate CAe.g. Let's Encryptstudy.demee.ccyour leaf certificatesignssignsthe browseralready has it
The browser walks the chain up to a root it already trusts. Forget to send the intermediate and some clients fail with "unable to get local issuer certificate".

Let's Encrypt, ACME and certbot

Let's Encrypt is a free, non-profit CA. Its certificates last 90 days by default (it plans 45 days by 2028) and everything runs over the ACME protocol. To prove control of a domain, the client passes a challenge:

  • HTTP-01: serve a token at http://yourdomain/.well-known/acme-challenge/<token>. Needs port 80 open and DNS already pointing at the server.
  • DNS-01: create a TXT record at _acme-challenge.yourdomain. Works for private servers, and is the only way to get a wildcard.
$ sudo apt install certbot python3-certbot-nginx
$ sudo certbot --nginx -d example.com -d www.example.com
#   passes HTTP-01, gets the cert, edits the Nginx config, reloads Nginx
$ sudo certbot certificates             # names and expiry dates
$ sudo certbot renew --dry-run          # test renewal against the staging server
$ systemctl list-timers | grep certbot  # the timer that renews automatically

Files land in /etc/letsencrypt/live/example.com/: fullchain.pem (leaf plus intermediates: what the server should send) and privkey.pem (never share or commit it). Configured by hand, Nginx looks like this:

server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://$host$request_uri;      # send all HTTP to HTTPS
}

server {
    listen 443 ssl;
    server_name example.com www.example.com;
    ssl_certificate     /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    ssl_protocols       TLSv1.2 TLSv1.3;

    location / {
        proxy_pass http://127.0.0.1:3000;       # the app, plain HTTP on localhost
    }
}

Caddy, Traefik and Kubernetes' cert-manager do the whole ACME dance automatically.

Let's Encrypt stopped sending "your certificate expires soon" emails in June 2025. Check that renewal works (renew --dry-run) and monitor expiry yourself.

Checking a certificate

$ echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
    | openssl x509 -noout -subject -issuer -dates -ext subjectAltName
subject=CN = example.com
issuer=C = US, O = Let's Encrypt, CN = YR1
notBefore=Sep  1 08:14:02 2026 GMT
notAfter=Nov 30 08:14:01 2026 GMT
X509v3 Subject Alternative Name:
    DNS:example.com, DNS:www.example.com
  • -servername sets SNI; without it a multi-site server may hand you its default certificate. Without the pipe, s_client prints the whole chain and ends with Verify return code: 0 (ok); any other code names the problem.
  • openssl x509 -noout -checkend 2592000 fails if the certificate expires within 30 days: handy in cron or CI.
$ curl -v https://example.com -o /dev/null
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / X25519 / RSASSA-PSS
* Server certificate:
*  subject: CN=example.com
*  expire date: Nov 30 08:14:01 2026 GMT
*  subjectAltName: host "example.com" matched cert's "example.com"
*  issuer: C=US; O=Let's Encrypt; CN=YR1
*  SSL certificate verify ok.

(Wording varies slightly between versions, and the issuer depends on which intermediate signed the certificate.) In production, let monitoring watch expiry: Prometheus's blackbox exporter exposes probe_ssl_earliest_cert_expiry.

Common errors and fixes

What you seeCauseFix
certificate has expired
Chrome: NET::ERR_CERT_DATE_INVALID
Renewal silently failed (rarely: the client's clock is wrong).sudo certbot renew and reload. Find out why: port 80 blocked, DNS moved, or no reload after renewal (--deploy-hook "systemctl reload nginx").
no alternative certificate subject name matches target host name
Chrome: NET::ERR_CERT_COMMON_NAME_INVALID
Valid certificate, wrong name: e.g. it covers example.com but not www, or the wrong server block answered.Reissue with every name (-d example.com -d www.example.com); check server_name.
self-signed certificate
Chrome: NET::ERR_CERT_AUTHORITY_INVALID
Signed by itself or by a private CA the client doesn't trust.Use a public CA on public sites. Internally, trust your CA: curl --cacert ca.crt or update-ca-certificates.
unable to get local issuer certificateNo chain to a trusted root: intermediate not sent, or an outdated CA bundle.Use fullchain.pem, not cert.pem; update ca-certificates.
wrong version numberTLS spoken to a plain-HTTP port.Use http:// there, or connect to the TLS port (443).
curl -k (--insecure) skips certificate checks. Fine for a quick test, never in scripts or pipelines: it throws away authentication, so anyone could impersonate the server.

Questions

Pick an answer. Get it wrong and you can try again right away, no waiting. 10 questions per topic - pick a filter below, then use Recreate questions for a fresh set on that topic.

Fresh questions every time

Exam

A mixed test across the whole site, shuffled so you never know which topic comes next. When you submit, every mistake comes with the reason and a jump to the exact moment in the video that explains it.

30 questions 6 topics 20 minute limit Up to 70 XP
1–4 answer · ←→ move
History

Essay

0 / 200-250 words
Sample answer
History
0:00 / 0:00
Not started

on YouTube
Subscribe

Topic progress

Activity

Achievements

Settings

Your profile and your account.

Profile details

* Required. Saved in this browser until you sign in.

Letters, numbers, dots, dashes and underscores.
0 / 160

Account

Checking…

App

Install Stackwise on your phone or computer. It opens in its own window from your home screen, and the Docs and cheat sheets you've opened keep working without internet.

Only admins can see this

Dashboard

Sign-ups, activity, messages and reviews in one place.

Prove it

Certificates

Pass a topic's test and get a certificate with its own public page you can share or add to LinkedIn. Each test is 10 questions drawn at random and graded on the server; you need 8 right, you have 15 minutes, and you get one try per topic a day.

From first command to production

Linux for DevOps

A path through Linux the way DevOps engineers use it: ten stages, every command explained with its flags, examples, real output and mistakes, the combinations engineers chain together, and incidents worked through step by step. Practise everything in a safe lab folder.

Before the interview

Interview prep

Questions that come up in real DevOps interviews, with the kind of answer that lands. Say yours out loud first, then compare. Each one links to the chapter that goes deeper.

    Private to you

    My notes

    Everything you wrote down while watching and reading, in one place. Saved to your account, never shown to anyone.