CampusFlow
SecuritySSL / TLS

SSL / TLS

Understanding SSL/TLS protocols, the handshake process, PKI, HTTPS, and how encryption secures web communications.

What is SSL / TLS?

Cryptographic protocols that provide secure communication over a network

Encryption

All data transmitted between client and server is encrypted using symmetric keys derived during the handshake. This ensures confidentiality — eavesdroppers cannot read the data.

Authentication

Servers (and optionally clients) present digital certificates issued by trusted CAs. This verifies the server's identity and prevents impersonation attacks.

Integrity

Message Authentication Codes (MACs) ensure data is not tampered with during transmission. Any modification will be detected by the receiving party.

TLS Handshake

The sequence of messages exchanged to establish a secure connection

ClientServer
1

ClientHello

Client sends supported TLS versions, cipher suites, and a random number.

2

ServerHello

Server selects cipher suite, sends its digital certificate and a random number.

3

Certificate Verification

Client verifies the server's certificate against trusted CAs.

4

Key Exchange

Client generates pre-master secret, encrypts with server's public key.

5

Session Keys Derived

Both sides derive symmetric session keys from the pre-master secret.

6

Finished

Both sides send encrypted 'Finished' messages. Secure channel established.

Certificate Authorities & PKI

The infrastructure that enables trusted digital identities

How PKI Works

  • Root CAs are trust anchors (self-signed, pre-installed in browsers/OS)
  • Intermediate CAs are signed by root CAs to issue end-entity certificates
  • Server certificates bind a domain name to a public key
  • Certificate chains are verified up to a trusted root
  • Revocation via CRL (Certificate Revocation List) or OCSP

Major CAs

  • Let's Encrypt — free, automated certificates (ACME protocol)
  • DigiCert — enterprise-grade certificates
  • GlobalSign — SSL, code signing, and email certificates
  • Sectigo — high-volume certificate provider
  • Cloudflare — managed TLS with universal SSL

TLS 1.2 vs TLS 1.3

FeatureTLS 1.2TLS 1.3
Handshake RTT2 round trips1 round trip (0-RTT for resumption)
Cipher Suites37+ suites (many insecure)5 AEAD suites (all secure)
Key ExchangeRSA, DH, ECDH (some without PFS)ECDHE only (PFS mandatory)
Encrypted HandshakePartially encryptedFully encrypted
Legacy AlgorithmsRC4, 3DES, CBC mode allowedAll removed
Downgrade ProtectionLimitedBuilt-in downgrade prevention
AdoptionWidely deployed (legacy support)Increasingly standard

HTTPS — HTTP over TLS

How HTTPS uses TLS to secure web traffic

How It Works

  1. Browser connects to port 443 (default for HTTPS)
  2. TLS handshake occurs before any HTTP data is sent
  3. After secure channel established, HTTP requests are encrypted
  4. All HTTP headers, URLs, cookies, and body are encrypted
  5. Only server IP and SNI hostname remain visible

Benefits

  • Prevents eavesdropping on sensitive data
  • Protects against content injection by ISPs
  • Required for HTTP/2 and HTTP/3
  • SEO ranking boost (Google prefers HTTPS)
  • Enables modern web APIs (geolocation, service workers)
  • Prevents referrer header leakage

Common Attacks on SSL/TLS

Historical vulnerabilities and how they have been addressed

POODLE

(2014)

Padding Oracle On Downgraded Legacy Encryption. Exploited SSL 3.0's CBC padding to decrypt plaintext. Fixed by disabling SSL 3.0 entirely.

Heartbleed

(2014)

Buffer over-read bug in OpenSSL's Heartbeat extension. Allowed reading server memory (including private keys). Fixed by patching OpenSSL.

BEAST

(2011)

Browser Exploit Against SSL/TLS. Exploited TLS 1.0's CBC IV chaining to decrypt cookies. Fixed by prioritizing RC4 (later deprecated) and moving to TLS 1.1+.

TLS Best Practices

Use TLS 1.3 as the preferred protocol; TLS 1.2 as fallback
Disable SSL 2.0, SSL 3.0, TLS 1.0, and TLS 1.1
Use strong cipher suites: TLS_AES_128_GCM_SHA256 or better
Enable HSTS (HTTP Strict Transport Security)
Use 2048+ bit RSA keys or ECDSA with P-256/P-384 curves
Implement certificate revocation via OCSP stapling
Use Perfect Forward Secrecy (ECDHE key exchange)
Regularly check with SSL Labs for configuration issues
Automate certificate renewal (e.g., Let's Encrypt + ACME)
Monitor certificate expiry and receive alerts

Interview Questions

Common SSL/TLS interview questions with answers