Kahibaro
Discord Login Register

SSL/HTTPS

Understanding SSL/TLS and HTTPS

Secure web servers rely on TLS (often still called SSL) to encrypt HTTP traffic, provide integrity, and optionally authenticate clients. In practice:

Modern deployments use TLS (SSL is obsolete), but tools, configs, and docs still say “SSL” in many places.

TLS Handshake (High-Level)

When a client connects to an HTTPS site:

  1. ClientHello
    Client proposes:
    • TLS versions it supports
    • Cipher suites
    • Extensions (e.g., SNI for virtual hosts)
  2. ServerHello + Certificate
    Server chooses:
    • TLS version
    • Cipher suite
      And sends:
    • Its certificate chain
    • Optional additional parameters (e.g., key share for TLS 1.3)
  3. Key Exchange
    Client and server:
    • Agree on a shared secret (e.g., via ECDHE)
    • Derive symmetric keys for encryption and MAC
  4. Finished Messages
    Both sides:
    • Switch to encrypted communication
    • Verify handshake integrity

From this point, application data (HTTP) is encrypted.

Certificates and Certificate Authorities

Certificate Structure (Server-Side View)

A typical server certificate contains:

For an HTTPS site, browsers expect:

Chain of Trust

On Linux web servers you usually deploy:

The client validates:

  1. Server cert ← signed by intermediate CA
  2. Intermediate CA ← signed by root CA
  3. Root CA is trusted by system/browser

If the chain is incomplete, clients may show “insecure” or “untrusted” warnings.

Types of Certificates (from an Admin Perspective)

From a Linux server configuration standpoint, DV is sufficient for encryption and browser padlock.

Getting and Managing Certificates

ACME and Let’s Encrypt

Let’s Encrypt + ACME is the dominant free, automated TLS solution.

Key ideas:

The ACME client:

  1. Generates a private key and CSR
  2. Completes challenge(s)
  3. Receives certificate + intermediate(s)
  4. Installs them and (often) reloads/restarts the web server
  5. Renews certificates automatically before expiration (typically every 60–80 days for 90-day certs)

As an admin, you must ensure:

Self-Signed Certificates

Self-signed certs are useful for:

Limitations:

On Linux, you can generate one with openssl (basic idea, not full command set):

Use self-signed CA + server certs signed by that CA if you have multiple internal services.

Certificate Lifecycle

As a server admin, track:

Key management practices:

TLS Configuration on Linux Web Servers

Core Concepts

Across Apache and Nginx, the basic pieces are similar:

You bind these to a virtual host or server block listening on port 443.

Always:

Protocol Versions

Modern baseline:

In config formats you will see things like:

Older clients (e.g., legacy OSes/browsers) may break when you drop TLS 1.0/1.1; you must weigh security vs compatibility.

Cipher Suites

A cipher suite defines:

As an admin, typical goals:

Instead of handcrafting suites, many admins use recommended sets from:

Hardening HTTPS

HTTP to HTTPS Redirection

Prefer all traffic over HTTPS. Implement:

Consider:

HSTS (HTTP Strict Transport Security)

HSTS instructs browsers to:

Typical header:

Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

Notes:

OCSP Stapling

OCSP stapling lets the server provide an OCSP response from the CA during the TLS handshake:

You typically enable it in the web server configuration and ensure the server can reach the CA’s OCSP responder.

Perfect Forward Secrecy

Forward secrecy ensures that compromising the server’s long-term private key does not allow decryption of past sessions.

Achieved by:

Most modern server configurations already favor ECDHE-based suites.

Performance and Optimization

Session Resumption

TLS handshakes are expensive. Two mechanisms help:

Benefits:

Cautions:

TLS 1.3 Advantages

TLS 1.3:

From an admin perspective, enabling TLS 1.3:

Hardware and Offloading

On high-traffic servers:

Operational Practices

Testing and Verification

Tools to validate HTTPS setup from a Linux server:

External tools:

Verify:

Logging and Troubleshooting

In case of TLS problems:

For mixed content problems:

Mixed Content

When migrating to HTTPS:

Prevention:

Summary Checkpoints for an Admin

When configuring SSL/HTTPS on a Linux web server, ensure:

Views: 21

Comments

Please login to add a comment.

Don't have an account? Register now!