[Certificate Fundamentals Part 1] Why Do We Need Certificates? The Three Things TLS Protects and Man-in-the-Middle Attacks

Certificate Fundamentals Part 1 Why Do We Need Certificates? The Three Things TLS Protects and Man-in-the-Middle Attacks Certificates and PKI

“The certificate is about to expire. Could you renew it?”
“The management console always shows a certificate warning, but I just click ‘Advanced’ and proceed.”

You have probably heard words like these at work. Certificates are often seen as “something you renew when it expires.” Behind them, though, several mechanisms work together: encryption that hides the content of communication, hashes and signatures that detect rewriting, and PKI (public key infrastructure) that verifies the other party is genuine. If you don’t know how they work, the only thing you can do when a certificate error appears is “ignore the warning and proceed.”

This series starts by explaining why certificates are needed in terms of three threats, then covers, in order, the basics of cryptography, what is inside a certificate, how trust works, how TLS operates, issuance and automatic renewal, private PKI and certificates in the cloud, and how to isolate errors. Commands center on openssl, with steps for Windows’ built-in PowerShell and certutil alongside. Specifications and figures are current as of September 2026 (shorter validity periods, TLS 1.3, post-quantum cryptography, and more).

Part 1 asks why we need certificates in the first place.

▶ This part is also available as a YouTube video (about 18 min) (it is also embedded at the end of this article).

Diagram showing certificates at the center of many scenarios, including the web (HTTPS), email, VPN, AD sign-in, wireless LAN, and cloud load balancers, with the same content in every case: "public key + CA signature"

Certificates are used in many places besides the web: email, VPNs, wireless LANs, Active Directory sign-in, and cloud load balancers. The scenarios differ, but the content is always the same: “public key + CA signature.” And secure communication starts with verifying the other party.


How this series is organized

The series has 11 parts, in this order.

PartThemeMain topics
Part 1Why certificates are neededThe three threats, what TLS protects, man-in-the-middle attacks, the role of certificates
Part 2Cryptography basicsSymmetric encryption, public key encryption, key exchange, hashes, signatures, PQC
Part 3Trying it with openssl and PowerShellCreating keys, encryption, hashes, signatures, self-signed certificates
Part 4Inside an X.509 certificateSAN, extensions, file formats, how to read the contents
Part 5PKI and how trust worksChains, trust stores, revocation, CT, CAA
Part 6Certificate types and issuanceDV/OV/EV, CSRs, domain validation, shorter validity periods
Part 7How TLS worksTLS 1.3, cipher suites, SNI/ECH, mTLS, PQC
Part 8Lifecycle and automationExpiration incidents, inventory, ACME, expiration monitoring
Part 9Private PKI and the cloudAD CS, ACM, Private CA, load balancers, vSphere
Part 10TroubleshootingHow errors appear, isolation steps, wrap-up
Part 11Design exercisesThinking through five cases

Parts 1 to 3 are the foundation. Part 2 uses no math and focuses on “which component protects what.” Part 3 is hands-on: openssl on Linux and Mac, and the built-in PowerShell and certutil on Windows (WSL is not assumed). For the “Think about it” questions at the end of each part, try answering with your own workplace in mind.

Certificates are also closely tied to DNS. CAA records, which declare which certificate authorities may issue certificates, and TXT records, which show that you own a domain, are also covered in Part 6 of the earlier series DNS Fundamentals.


The three threats to insecure communication

Internet traffic passes through many devices and lines that you do not manage. On public Wi-Fi, at your internet provider, at routers along the path, and sometimes even inside your corporate LAN, there may be someone in a position to look at your traffic or tamper with it.

Three threats can occur there.

Diagram of three threats: eavesdropping (an attacker reads the content as is), tampering (rewriting "Start work at 10:00" to 13:00), and impersonation (the sender sends to a fake recipient believing it is the real party, and nothing reaches the real one)
  1. Eavesdropping: A third party reads the content of the communication
  2. Tampering: The content is rewritten along the way. For example, if a message saying “Start work at 10:00” is changed to “Start work at 13:00,” an incident happens without the sender or the recipient noticing
  3. Impersonation: The other party is not the genuine one but has been replaced by an attacker

What matters is that these three are separate problems. Preventing one does not prevent the others. With encryption alone, you can notice neither rewriting nor a swapped party. You have to assume the path cannot be controlled and build security at both ends of the communication.

Key points
• The threats are eavesdropping (being read), tampering (being rewritten), and impersonation
• The three are separate problems; preventing one does not prevent the others
• Assume the path cannot be controlled, and build security at both ends of the communication


What TLS protects

TLS handles these three threats with a separate component for each.

Diagram showing that eavesdropping is countered by confidentiality (AES-GCM, with keys from ECDHE), tampering by integrity (the AEAD tag), and impersonation by authentication (a certificate and a private key signature), and that TLS works between the application and TCP
ThreatProperty protectedHow TLS does itDetails in
EavesdroppingConfidentiality (not read)Data is encrypted with symmetric encryption (AES-GCM, etc.). The keys are created by key exchange (ECDHE)Part 2
TamperingIntegrity (not rewritten)Authenticated encryption (AEAD) detects tampering in each piece of data sentPart 2
ImpersonationAuthentication (the other party is genuine)The server presents a certificate and signs with the matching private key to show that it is the ownerParts 4 and 5
(Out of scope)What cannot be hiddenIP addresses, traffic volume and timing, the name of the destination (SNI, unless ECH is used)Part 7

TLS works above TCP (QUIC in HTTP/3) and below the application. That is why it can protect many protocols, such as HTTP, SMTP, IMAP, and LDAP, in the same way.

On the other hand, TLS protects only the communication along the path. It does not guarantee the data stored on the server, or whether the server itself is safe. “It’s HTTPS, so it’s safe” means “it won’t be read or rewritten along the way,” not “the site can be trusted.”

Also note that the actual data is encrypted with symmetric encryption, not public key encryption (explained in Part 2).


Encryption alone is not enough: man-in-the-middle attacks

This is the most important part of Part 1.

With public key encryption, you can communicate secretly without sharing a key in advance, simply by encrypting with the other party’s public key (Part 2). However, you cannot tell whether a public key really belongs to the other party just by looking at it.

Diagram of a man-in-the-middle attack: the attacker hands the client its own public key saying "This is the server's public key" and makes a separate connection to the server, so both sides see encryption succeed while the attacker reads and rewrites the content

Suppose an attacker cuts into the middle of the communication and does the following:

  • Hands the client its own public key, saying “This is the server’s key”
  • Makes a separate connection to the server itself

The attacker can then read and rewrite the content while encrypting correctly with both sides. It decrypts on its own machine, reads, rewrites, re-encrypts, and forwards. This is a man-in-the-middle attack (MITM).

The frightening part is that both encryption and signature verification “succeed” in this situation. Both sides see “encryption succeeded,” so users cannot notice anything is wrong.

  • Connecting while ignoring a certificate warning means giving up this check yourself
  • An unverified self-signed certificate is the same. If an attacker swaps in a different self-signed certificate, you cannot tell them apart, and neither eavesdropping nor tampering is prevented

The “I always ignore the warning and proceed” from the beginning is exactly a case of allowing this yourself. Without verifying the other party, encryption and tamper detection lose their meaning.

Key points
• You cannot tell from a public key alone whether it belongs to the genuine party
• In a man-in-the-middle attack, data is eavesdropped on and tampered with while encryption and verification both succeed
• Ignoring warnings or trusting unverified self-signed certificates breaks all three protections


The role of certificates: binding a public key to its owner

To prevent man-in-the-middle attacks, you need a trusted third party to vouch that “this public key really belongs to the owner of www.example.com.” That guarantee is a certificate.

Diagram matching a driver's license (issuer: the licensing authority, name, photo, watermark) to a server certificate (issuer: certificate authority, subject: www.example.com, public key, CA's digital signature), with the identity check done by the server signing with its private key and the peer verifying with the certificate's public key

An identity document makes a good analogy. A driver’s license works as proof of identity because it is issued by an authority everyone trusts and is hard to forge. Because you trust the issuer, you can trust the name and photo on it.

Driver’s licenseServer certificate
Issuer: the licensing authorityIssuer: certificate authority (CA)
NameSubject: a name such as www.example.com
PhotoPublic key
Watermark and hologramCA’s digital signature

Keep in mind that a certificate itself is public information that anyone can copy. Just as you compare the photo on a license with the person’s face, TLS has the server sign with the private key that pairs with that public key to confirm it is the genuine owner. Stealing a certificate does not let you become the owner without the private key.

Only when the issuer, the content, and the identity check all line up can you trust it.

Key points
• A certificate is a pairing of “a public key and its owner’s name” vouched for by a CA’s signature
• A certificate is public information. Ownership is proven by holding the private key
• Because you trust the CA, you can trust certificates the CA has signed


Certificates around you

Certificates are not just for the web.

UseWho the certificate verifiesHow it is used
Web (HTTPS)Web serversThe browser verifies the server certificate (Part 7)
Mail transport (STARTTLS, SMTPS, IMAPS)Mail serversTLS protects server-to-server and client-to-server connections, hop by hop (Part 4 of the Email Fundamentals series)
Message content (S/MIME)SendersSigns and encrypts the message body. It can be verified even after delivery and protects it end to end
VPN (IPsec IKEv2, SSL-VPN)VPN devices and endpointsAuthenticates with the device’s certificate and the endpoint’s or user’s certificate
Wireless LAN (802.1X EAP-TLS)RADIUS servers and endpointsThe endpoint verifies the server certificate, and the server verifies the endpoint’s certificate
Code signingSoftware publishersSigns distributed files to show the publisher and whether they have been tampered with (Part 3)
AD smart card and certificate sign-inUsers and DCsSigns in with a certificate instead of a password through Kerberos PKINIT

It is not only servers that present certificates. In many uses, such as EAP-TLS, certificate sign-in, and VPNs, the client also holds a certificate (mutual authentication; mTLS in Part 7), and inside organizations these certificates are usually issued by a private CA (Part 9).


How this differs from an SSH host key

When you think of “verifying a server’s key,” SSH may come to mind. What is the difference between an SSH host key and a TLS certificate?

Diagram contrasting TLS, where the server presents a certificate and the browser automatically checks it against the list of CAs in its trust store, with SSH, where the user checks the fingerprint the first time, saves it in known_hosts, and afterward the key is checked against it and a changed key triggers a warning and a stop
AspectTLS server certificateSSH host key (typical use)
Who vouches for itA CA vouches with its signatureNo one. The user verifies it themselves
First connectionVerified automatically based on trusted CAsThe fingerprint is shown and the user answers yes (TOFU)
Where it is rememberedNot remembered (verified every time)Saved in ~/.ssh/known_hosts
When the key changesNo problem if the new certificate is signed by a CAWarns REMOTE HOST IDENTIFICATION HAS CHANGED! and does not connect
Name checkMatches the certificate’s SAN against the name you connected toMatches against the name or address recorded in known_hosts
Expiration and revocationHas validity periods and revocationThe host key itself has no expiration or revocation

SSH uses TOFU (Trust On First Use): it “trusts the first time.” If there is a man in the middle on the first connection, it cannot detect it. Countermeasures include checking the fingerprint through a separate channel, using DNSSEC and SSHFP records, and switching to a CA model with OpenSSH certificates (a proprietary format, not X.509).

Remember it this way: TLS has a third party that vouches; SSH remembers on its own.


Think about it

  1. Are there internal systems or device management consoles you connect to while ignoring a certificate warning? Which of the three threats are not being prevented on those connections?
  2. When someone says “It’s HTTPS, so it’s safe,” name one thing TLS protects and one thing it does not.
  3. Which systems at your workplace use certificates for something other than the web (wireless LAN, VPN, email, AD, and so on)? Who issues those certificates, and when do they expire?

Hint: Look at “What cannot be hidden” in the table under “What TLS protects,” the man-in-the-middle section, and the list under “Certificates around you.”


Summary

  • The threats to communication are eavesdropping, tampering, and impersonation. Preventing one does not prevent the others
  • TLS protects confidentiality, integrity, and authentication with separate components. It protects only the communication along the path
  • A public key alone does not tell you whether it is genuine. In a man-in-the-middle attack, encryption still succeeds while data is eavesdropped on and tampered with
  • A certificate is a public key and its owner’s name vouched for by a CA’s signature. Ownership is proven with the private key
  • Ignoring warnings breaks all three protections

Next time, we look one by one at the cryptographic building blocks behind certificates: symmetric encryption, public key encryption, key exchange, hashes, and signatures.


Watch the video

This part is also explained in a YouTube video (about 18 min).

All parts of the series are in the Certificate Fundamentals playlist on YouTube.

The Certificate Fundamentals series (11 parts)

All 11 parts with a reading guide: Certificate Fundamentals

  1. Why Do We Need Certificates? (this article)
  2. Cryptography basics
  3. Trying it with openssl and PowerShell
  4. Inside an X.509 certificate
  5. PKI and how trust works
  6. Certificate types and issuance
  7. How TLS works
  8. Lifecycle and automation
  9. Private PKI and the cloud
  10. Certificate troubleshooting
  11. Certificate design exercises

This series is the English edition of 【証明書入門】, originally written in Japanese.

コメント

Copied title and URL