Module 6 · Cryptography and PKI · Lesson 18 of 75
PKI, certificates and TLS, with an openssl lab
Certificate authorities and the chain of trust, what is inside a certificate, the TLS handshake, revocation, common crypto failures, and inspecting a site's certificate with openssl.
In this lesson · about 40 minutes
- Explain how certificate authorities and the chain of trust work
- Read a certificate's key fields and spot common problems
- Inspect a TLS connection with openssl
Public key infrastructure (PKI)
- A certificate (X.509) binds a public key to a name, signed by a certificate authority (CA).
- Chain of trust: a root CA (kept offline, pre-installed in browsers and operating systems) signs intermediate CAs, which sign the leaf (server) certificates. The browser follows the chain up to a root it trusts.
- To get a certificate, you create a key pair and a certificate signing request (CSR); the CA checks you control the domain and signs it. Let's Encrypt does this for free, automatically, with 90-day certificates.
- Companies also run private CAs for internal sites, VPNs, Wi-Fi (802.1X) and smart cards.
What is inside a certificate
| Field | Meaning |
|---|---|
| Subject / Subject Alternative Names (SAN) | The names it is valid for (www.example.com, *.example.com). Browsers only use the SAN list. |
| Issuer | The CA that signed it |
| Validity (Not Before / Not After) | Expired certificates break sites and train users to click through warnings |
| Public key and algorithm | RSA 2048+ or ECDSA P-256 |
| Key usage | What the key may do (server authentication, code signing...) |
| Signature | The CA's signature over all of the above |
Revocation
If a private key is stolen, the certificate must be revoked before it expires. Browsers learn this through CRLs (lists of revoked serial numbers) or OCSP (ask the CA about one certificate), ideally stapled by the server. Short-lived certificates reduce the problem.
TLS in practice
- Use TLS 1.3 (and 1.2 where needed). SSL 2/3 and TLS 1.0/1.1 are retired.
- HSTS tells browsers to always use HTTPS for a site, blocking downgrade tricks.
- Mutual TLS (mTLS): the client also presents a certificate, common between services and in zero-trust designs.
- Companies sometimes run TLS inspection: a proxy decrypts and re-encrypts traffic using a company CA installed on laptops. It helps find malware, but it is itself a high-value target and a privacy question.
Common crypto failures (and test findings)
- Home-made or obsolete algorithms; ECB mode; MD5/SHA-1 for security.
- Keys hard-coded in apps or committed to Git; keys never rotated.
- Certificate validation switched off in code ("it was failing in testing").
- Expired, self-signed or wrong-name certificates on production sites.
- Weak random numbers for keys and tokens (use the operating system's cryptographic random generator).
Hands-on lab (simulated terminal)
Lab: inspect a certificate with openssl
From your lab VM, inspect the TLS setup of your own lab web server, shop.lab.test. Output is simulated.
Step 1 of 4. Type each command and press Enter. Nothing runs on your computer.
1. Open a TLS connection to shop.lab.test on port 443 and show the certificate chain.
Flashcards
Module 6 flashcards
0 of 12 known
Say the answer out loud, flip the card, then be honest: cards you miss come back at the end.
Practice exam
Module 6 checkpoint
10 questions, 12 minutes.
- 10 questions · 12 minutes
- No feedback until you submit. Flag questions to come back to them.
- Aim for 85% or better before you move on. The real exam's 750 out of 900 is roughly 80–83%.
Written by Noviq Academy in its own words. All labs are simulations: no real systems are touched, and every name, address, password and hash is made up. The offensive techniques taught here are for defending systems and for authorised testing only; never scan, access or test a system without the owner's written permission. Tool and product names belong to their owners, and command output may differ slightly from yours. Read-aloud uses your device's built-in voices.