Security Playbook
17 · Crypto for developersOWASP A04:20256 min read

TLS: encryption is the easy part, identity is the point

HTTPS encrypts traffic, but its real job is proving you're talking to the right server. What the handshake does, why certificate validation matters more than cipher choice, and the settings worth getting right.

In one sentence

TLS gives you confidentiality, integrity and server authentication. Without validating the certificate you get encryption with whoever is in the middle.

The handshake in one picture

Client and server agree on keys using a key exchange (ECDHE), and the server proves its identity with a certificate signed by a certificate authority the client trusts. If anyone sits in between, they can't present a valid certificate for your domain, unless the client stops checking.

TLS: who are you talking to?
Scenario
Your appbank.testCA-signed certCafé Wi-Fi01 ClientHello: supported ciphers + key share02 ServerHello + certificate for bank.test03 Verify: signed by a trusted CA? name matches?04 Both derive the same session keys05 Encrypted HTTP
Encryption without authentication is pointless: TLS's real job is proving you reached the right server. Never disable certificate validation, not even "just in dev" code that ships.
Three scenarios: the real server, an attacker on the café Wi-Fi, and an app that disabled certificate checks.

Settings worth getting right

  • TLS 1.2 minimum, TLS 1.3 preferred. Older versions and ciphers are disabled by default in modern servers and CDNs; keep it that way.
  • HSTS: Strict-Transport-Security: max-age=63072000; includeSubDomains so browsers never try plain HTTP again.
  • Automatic renewal: ACME / Let's Encrypt or your cloud's certificate manager. Expired certificates cause outages and teach users to click through warnings.
  • Never disable validation: rejectUnauthorized: false, verify=False or trust-all managers in mobile apps are man-in-the-middle bugs waiting to ship.
  • Internal traffic too: service-to-service calls inside your network can use mutual TLS, where both sides present certificates.

Key takeaways

  • 01TLS's key job is authenticating the server.
  • 02Disabling certificate validation silently removes that protection.
  • 03Use TLS 1.2+/1.3, HSTS and automated renewal.
  • 04Consider mutual TLS for internal service traffic.

Check your understanding

1 of 3

What is TLS's most important job beyond encryption?

Related concepts