Cyberlium

Cryptography › Module 3 › Lesson 2

BeginnerModule 3Lesson 2/5

SSL Certificates

Read certificate fields: subject, issuer, validity, and SANs that browsers check

15 min+19 XP3 quiz
Module progress2 of 5
https://🔒
Browser bar · https:// · Green padlock

Opening

Read the passport fields — subject, issuer, dates, SANs — not the flag color on the URL bar.

People still say “SSL certificate” even when the protocol is TLS. The object is an X.509 certificate: a signed statement that this public key is bound to these names until this expiry, issued by this authority. Browsers do not “feel” trust. They check fields. If you can read subject, issuer, Not Before / Not After, and Subject Alternative Names (SANs), a red error page becomes a sentence: name mismatch, expired, untrusted issuer — not “the internet is broken, click Advanced.” This lesson is field literacy. You will copy those four families of fields into $HOME/cyberlium-lab from a public certificate on example.com or a domain YOU own. You will not install the PEM as a root CA. You will not rewrite someone else’s certificate. You will not treat a valid cert on phishing-bank.example as a reason to type a PIN. Next — Certificate Authorities — is who signed the passport and what happens when that voucher is wrong.

1. Subject and SAN: the names the browser actually matches, not the pretty title in the tab

Historically the Common Name (CN) inside the Subject distinguished name carried the hostname. Modern browsers match Subject Alternative Names (SAN) — a list of DNS names (and sometimes IP addresses) the certificate is valid for. If you visit www.example.com, the client looks for that exact name, or a permitted wildcard like *.example.com (wildcards have rules: they do not silently cover example.com itself in every policy, and they do not cover arbitrary nested labels the way beginners hope). A cert for evil-login.net does not cover yourbank.com no matter how similar the logo is. Subject can still show an organization string on some certificates. That string is not a police background check. Domain Validation (DV) certificates prove control of the domain, not that the company is kind. When the name in the address bar does not appear in SAN (and is not a valid wildcard match), the browser must fail closed. “The page looked the same” is not a field. Clicking through a name mismatch on a site that asks for secrets is how account takeover starts. This course tells you to stop, not to invent a bypass.

SAN lists are also how one certificate covers www, the apex name, and a CDN hostname. When you inspect, write every DNS SAN you see. Ask: does the name I typed appear? If you used an IP in the URL, is that IP in SAN? If not, do not invent a reason the padlock “should still count.” The handshake lesson already told you encryption without the right name is a private chat with the wrong door. Certificate fields are how the client names the door.

2. Issuer, validity, and the public key: who signed, when it lives, what handshake math uses

Issuer is the distinguished name of the CA (or intermediate) that signed this certificate. You will fully unpack CAs in the next lesson. For field reading: copy the issuer string. It should be a known public CA or an intermediate whose chain walks to a root in the device trust store — not “CN=My Laptop MITM” that appeared after you installed a random .crt from a forum. Validity is two timestamps: Not Before and Not After. Expired certificates fail. Not-yet-valid certificates fail (clocks matter: a device with the year 2018 will reject a 2025 cert). Browsers treat those failures as trust failures, not as optional cosmetics. The certificate also carries a public key (RSA or elliptic-curve) and a signature over the rest of the fields. The handshake uses that public key in CertificateVerify (TLS 1.3): the server proves it holds the matching private key. You do not need to parse ASN.1 by hand. You need to know the public key is not the AES session key, not a password, and not something you paste into Slack. Leaf private keys stay on the server. If a PEM you found includes a PRIVATE KEY block, that is a secret — toy keys only in this course, never a live production key in git or chat.

Four field families you will record. Browsers check these; the tab icon is not a fifth family.

  • Subject / CN / SAN

    Which hostnames (and IPs) the cert covers. SAN is what modern name matching uses. Mismatch = stop.

  • Issuer

    Who signed it. Next lesson: whether that signer is a trusted CA or a random root you should never install.

  • Validity Not Before / Not After

    Time window. Expired or not-yet-valid fails trust. Do not click through on a site that wants secrets.

  • Public key

    The key used to prove possession in the handshake. Not the session AES key. Never paste a live private key.

3. Errors that mean stop: name mismatch, expiry, and “I recognize the logo”

NET::ERR_CERT_COMMON_NAME_INVALID (and cousins) means the SAN list does not include the name you typed. ERR_CERT_DATE_INVALID means the clock or the dates disagree. ERR_CERT_AUTHORITY_INVALID means the chain does not land on a trusted root — the next lesson’s territory, including the disaster of installing a random root to “make the error go away.” None of those errors mean “add an exception because I am in a hurry.” On a bank, a password form, or email, you stop. You may inspect a public certificate on example.com or your own domain to learn what a healthy field set looks like. You may not teach a roommate to ignore Chrome’s interstitial so their homework loads.

4. Wrong vs right: clicking through vs reading SAN, issuer, and dates on a public cert you may fetch

Worked failure — treating the cert viewer as optional and the logo as a field. Right is four families copied into locked notes.

  • Wrong

    Visit a look-alike bank, see a padlock, skip SAN. Click through expiry because the UI looks familiar. Install a .crt from a chat so a school portal “works.” Copy a production PRIVATE KEY into the notes. Forge a certificate for a domain you do not own. Intercept a classmate and replace their cert. Name mismatch is not a style choice.

  • Right

    On example.com or a domain YOU own, read subject, issuer, Not Before/Not After, and SAN DNS names. Confirm the name you typed is in SAN. Write the four families to $HOME/cyberlium-lab/cert-fields-notes.txt. chmod 600. Stop on mismatch/expiry when secrets are at stake. Next: Certificate Authorities.

5. Practical: dump public cert fields, write them in your own words, lock the file

openssl s_client completes a client handshake and prints the PEM. openssl x509 -noout then prints subject, issuer, dates, and the SAN extension. That is a read of a public certificate — the same bytes a browser already fetched. Target example.com or a hostname you operate. Do not aim this at a random company’s internal hostname you saw on a badge. Do not save a stolen private key. On Windows, use Git Bash or WSL if openssl is not on PATH. Then lock the notes. The next lab will repeat a similar dump into cert-lab.txt; this lesson is field vocabulary so that lab is not copy-paste without understanding.

Command guide

cert-fields-notes.txt — public cert on example.com or YOUR domain, never a fake CA

DEFENSIVE field literacy. Public certificate only. NEVER install this PEM as a root CA. NEVER intercept others.

Command — copy this

mkdir -p "$HOME/cyberlium-lab"
cd "$HOME/cyberlium-lab"
HOST="example.com"   # or a domain YOU own

Command — copy this

echo | openssl s_client -connect "${HOST}:443" -servername "$HOST" 2>/dev/null \
  | openssl x509 -outform PEM > "$HOME/cyberlium-lab/example-leaf.pem"

Command — copy this

openssl x509 -in "$HOME/cyberlium-lab/example-leaf.pem" -noout \
  -subject -issuer -dates -ext subjectAltName

Command — copy this

NOTES="$HOME/cyberlium-lab/cert-fields-notes.txt"
{
  echo "=== CERTIFICATE FIELDS ==="
  echo "host_I_typed: $HOST  (example.com OR a domain I own)"
  echo "subject:"
  echo "issuer:"
  echo "notBefore:"
  echo "notAfter:"
  echo "SAN_DNS_names:"
  echo "name_match: yes/no — does the name I typed appear in SAN?"
  echo "public_key_type: (RSA/EC — not the AES session key)"
  echo "ethics: public cert read only; no fake CA; no PRIVATE KEY from production; no click-through on banks"
} > "$NOTES"

Command — copy this

chmod 600 "$NOTES" "$HOME/cyberlium-lab/example-leaf.pem"

Windows without chmod: WSL/Git Bash, or restrict the files in your profile.

NEVER: openssl to a host you are not allowed to visit NEVER: certutil -addstore or install the PEM as a trusted root NEVER: paste a live private key into cert-fields-notes.txt

Mission: cert-fields-notes.txt with subject, issuer, dates, SAN (mode 600)

1) Fetch a public leaf certificate from example.com or a domain YOU own (openssl s_client | openssl x509, or the browser certificate viewer). 2) Write subject, issuer, Not Before, Not After, and SAN DNS names into $HOME/cyberlium-lab/cert-fields-notes.txt. Mark whether the name you typed appears in SAN. 3) chmod 600 the notes (and any PEM you saved). Do not install the cert as a CA. Do not click through name mismatch on a site that wants secrets.

Stuck? Ask Cyberlium AI Mentor

If “the padlock is enough, fields are for admins” still feels true, ask for a hint — not an ignore-errors flag. Try: "Hint only: which names do browsers match (SAN vs CN), what issuer and Not After mean, and why a valid cert on the wrong hostname is a stop?" You still fill cert-fields-notes.txt. No fake roots. No production private keys. No MITM.

You now read a certificate as a passport: names (SAN), signer (issuer), dates, public key. The pretty padlock is the result of those checks, not a substitute for them. Next — Certificate Authorities — is how issuer trust is bootstrapped, what mis-issuance looks like, why Certificate Transparency exists as a public log, and why you must not install random root CAs to silence a warning.

Knowledge Check

1

APPLY: You typed https://www.example.com. The cert’s SAN lists example.com and www.example.com; issuer is a public CA; dates are current. A friend says skip SAN because the logo matches a bank they like, and to click through if a different host mismatches. What do browsers check?

Multiple choice

Knowledge Check

2

APPLY: True or False: An expired certificate should fail browser trust, and the correct fix on a bank site is to install a random .crt from a forum so the interstitial disappears.

True or False

Knowledge Check

3

APPLY: You dumped example.com’s public cert into cyberlium-lab. Which record is the lesson, and what stays out?

Multiple choice

← Previous

Answer all 3 knowledge checks to continue. (0/3 answered)