# TLS and Certificates

> Understand how TLS encrypts traffic and proves identity, and how to issue, renew and debug certificates without outages. Free notes, key concepts, resources...

Canonical: https://www.internhack.in/roadmaps/tracks/devops/tls-certificates
Last updated: 2026-11-28

Understand how TLS encrypts traffic and proves identity, and how to issue, renew and debug certificates without outages.

Intermediate · about 5 hours · difficulty 3/5

Learn first: [HTTP and HTTPS](https://www.internhack.in/roadmaps/tracks/devops/http-https)

Expired or misconfigured certificates are a classic self-inflicted outage. TLS knowledge lets you set up HTTPS correctly, automate renewal and debug handshake failures.

### How it works

- **Asymmetric crypto** (public/private key pairs) authenticates the server and negotiates keys; **symmetric crypto** encrypts the bulk traffic.
- A **certificate** binds a public key to names (SANs) and is signed by a **Certificate Authority**. Clients trust a chain: leaf, intermediate(s), root in their trust store.
- The **handshake** negotiates version (use TLS 1.2+ and prefer 1.3), cipher, and uses **SNI** so one IP can serve many hostnames.

### Operating certificates

- **Let's Encrypt** and the **ACME** protocol give free, automated certificates (certbot, Caddy, cert-manager in Kubernetes).
- Cloud-managed certificates (AWS ACM, Google-managed) on load balancers remove renewal work.
- **mTLS** (mutual TLS) authenticates clients too; service meshes use it between services.
- Where TLS terminates matters: at the CDN, load balancer, ingress, or the app itself.

### Debugging

`openssl s_client -connect host:443 -servername host` shows the chain and expiry; `openssl x509 -in cert.pem -noout -text` inspects a file. Common errors: missing intermediate, wrong hostname, expired cert, clock skew.

**Good enough to move on:** you can issue a certificate with ACME, explain the chain of trust, and diagnose a failing handshake with openssl.

## Key concepts

- **Symmetric vs asymmetric crypto**
- **Certificates, CAs and chains**
- **TLS handshake and SNI**
- **Let's Encrypt and ACME**
- **openssl debugging**
- **Managed certificates (ACM etc.)**
- **mTLS**

## Mini project

Put a small site behind nginx with a Let's Encrypt certificate, automate renewal, then add a Prometheus-style check or cron job that warns you 14 days before any certificate expires.

## Check yourself

Browsers accept your site but a curl call from a server fails with a certificate error. What is a common cause?

## Free resources

- [Let's Encrypt documentation](https://letsencrypt.org/docs/) (Let's Encrypt)
- [What is TLS?](https://www.cloudflare.com/learning/ssl/transport-layer-security-tls/) (Cloudflare)

Previous: [HTTP and HTTPS](https://www.internhack.in/roadmaps/tracks/devops/http-https) · Next: [Load Balancing and Proxies](https://www.internhack.in/roadmaps/tracks/devops/load-balancing-proxies)

## More in Networking You Will Actually Debug

- [How the Internet Works: TCP/IP and the OSI Model](https://www.internhack.in/roadmaps/tracks/devops/internet-tcpip)
- [DNS in Practice](https://www.internhack.in/roadmaps/tracks/devops/dns)
- [HTTP and HTTPS](https://www.internhack.in/roadmaps/tracks/devops/http-https)
- [TLS and Certificates](https://www.internhack.in/roadmaps/tracks/devops/tls-certificates)
- [Load Balancing and Proxies](https://www.internhack.in/roadmaps/tracks/devops/load-balancing-proxies)
- [Firewalls, Security Groups and NAT](https://www.internhack.in/roadmaps/tracks/devops/firewalls-nat)
- [SSH, Bastions and VPNs](https://www.internhack.in/roadmaps/tracks/devops/ssh-vpn)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [DevOps Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/devops)
