security-course

Security, Privacy, and Consumer Protection

View the Project on GitHub noise-lab/security-course

Who Do You Trust? Digging Into Certificate Chains

1. Overview

Every time you visit a website over HTTPS, your browser uses digital certificates to verify that the server is who it claims to be. But where does that trust come from? Who says the certificate is valid? And what happens if something goes wrong?

In this activity, you’ll trace the certificate chain of a website back to a trusted root certificate on your own machine. You’ll see how Public Key Infrastructure (PKI) works in practice — and where the system might fall short.


2. Learning Objectives

By the end of this session, you should be able to:


3. Activity

Step 1: Pick a Website

Choose a well-known HTTPS site (e.g., https://github.com, https://uchicago.edu, https://mozilla.org). Avoid sites behind CDNs or pinned certs for now.

Step 2: Inspect the Certificate Chain

Use your browser’s tools to inspect the TLS certificate:

Answer these questions:

Step 3: Find the Root CA on Your Machine

Now locate the root certificate on your system. This shows that your computer explicitly trusts it.

Verify:

Step 4 (Optional): Explore Certificate Revocation

Investigate how your browser or OS handles revocation:

Bonus: Compare how different browsers respond to revoked or expired certs.

Step 5: Use openssl or certutil to Dive Deeper

Option A: Using openssl (Linux/macOS/Windows with WSL)
  1. Fetch the certificate from a server:
    openssl s_client -connect github.com:443 -showcerts
    
  2. Copy one PEM-formatted certificate block (starts with -----BEGIN CERTIFICATE-----) and save it as cert.pem.

  3. Inspect the certificate contents:
    openssl x509 -in cert.pem -text -noout
    
  4. Answer the following based on the output:
    • What is the Subject (who the certificate is for)?
    • What is the Issuer (who issued it)?
    • What is the Not Before / Not After validity period?
    • What is the Signature Algorithm?
    • What is the Public Key Algorithm and key size?
    • Are there any extensions like Subject Alternative Names, Key Usage, etc.?
Option B: Using certutil (Windows)
  1. List root certificates:
    certutil -store "Root"
    
  2. Search for a specific issuer (e.g., DigiCert, ISRG Root X1):
    certutil -store "Root" | findstr /C:"DigiCert"
    
  3. Export and inspect (optional):
    certutil -store "Root" > roots.txt
    

Write down any notable observations from the output.


4. Discussion

Let’s talk about what you found:

We’ll wrap up by discussing what “trust” means in a system where you didn’t choose the root of the trust chain.