mod_ssl In Depth: Certificates, Cipher Suites & OCSP Stapling

Apache In Depth

Chapter 6 · mod_ssl In Depth: Certificates, Cipher Suites & OCSP Stapling

Web Servers Fundamentals Chapter 7 paired SSLEngine on with SSLCertificateFile/SSLCertificateKeyFile and deliberately stopped there — it assumes HTTPS/TLS Fundamentals already covers what a certificate or a TLS handshake actually is, and this chapter keeps that same assumption. What neither of those courses covered is the set of mod_ssl directives that actually determine how secure that connection really is: which TLS versions are even allowed, which ciphers get used, and how the client confirms the certificate hasn't been revoked without slowing every connection down.

SSLCertificateFile Can Now Hold the Full Chain

<VirtualHost *:443> ServerName example.com SSLEngine on SSLCertificateFile /etc/ssl/certs/example.com-fullchain.crt SSLCertificateKeyFile /etc/ssl/private/example.com.key </VirtualHost>

Since Apache 2.4.8, SSLCertificateFile accepts a single file containing the leaf certificate and the full intermediate chain, concatenated in order — the separate SSLCertificateChainFile directive Fundamentals never mentioned still works for older setups, but a modern config typically doesn't need it at all. This is exactly the kind of detail that changes across Apache versions and is easy to find outdated advice about.

SSLProtocol: Restricting Which TLS Versions Are Allowed

SSLProtocol -all +TLSv1.2 +TLSv1.3

SSLProtocol controls which TLS (and legacy SSL) versions Apache will negotiate at all. The -all then +TLSv1.2 +TLSv1.3 pattern — deny everything, then explicitly re-allow only what's wanted — is the recommended form specifically because it fails safe: if a future TLS version is ever added to Apache's supported list by default, a config written this way doesn't silently start allowing it. A config that instead lists only positives (+TLSv1.2 +TLSv1.3 with no leading -all) can leave older, weaker protocol versions still enabled underneath, depending on Apache's own compiled-in defaults.

SSLCipherSuite & SSLHonorCipherOrder

SSLCipherSuite HIGH:!aNULL:!MD5:!3DES SSLHonorCipherOrder on

SSLCipherSuite takes a colon-separated cipher string: HIGH selects strong ciphers as a starting set, and each !-prefixed entry explicitly excludes a specific weak option (aNULL — no authentication at all, MD5 and 3DES — both cryptographically weak by modern standards) that might otherwise sneak in under a broader category. SSLHonorCipherOrder on tells Apache to enforce its own preferred cipher order rather than deferring to whatever order the connecting client offers — mainly relevant for TLS 1.2 and earlier, since TLS 1.3 negotiates from a small, fixed, already-strong cipher list and doesn't need this kind of manual curation.

OCSP Stapling

SSLUseStapling on SSLStaplingCache "shmcb:/var/run/ocsp(128000)"

OCSP (Online Certificate Status Protocol) is how a client checks whether a certificate has been revoked since issuance. Without stapling, that check is the client's own job: the browser itself contacts the certificate authority's OCSP responder on every connection — a real, live network round-trip that adds latency, can fail if the CA's responder is slow or unreachable, and quietly tells the CA which sites a given client is visiting. OCSP stapling moves that job to the server: Apache itself periodically fetches a signed, time-stamped "this certificate is still valid" response from the CA (cached and refreshed on its own schedule, not per-request), and attaches — staples — that response directly into the TLS handshake. The client gets the same proof of validity without ever contacting the CA itself.

DirectiveControlsCovered in Fundamentals?
SSLCertificateFile / SSLCertificateKeyFileCertificate and key locationYes — basic pairing only
SSLProtocolWhich TLS versions are allowedNo
SSLCipherSuite / SSLHonorCipherOrderCipher selection and priorityNo
SSLUseStapling / SSLStaplingCacheOCSP staplingNo
Where this heads next
Every directive in this chapter is exactly the kind of thing a real production <VirtualHost :443> block combines into one config — Chapter 10's capstone assembles a complete, hardened Apache deployment, and this chapter's own directives are what that block's TLS section will actually contain.
Restricting protocols too aggressively has a real cost
Disabling every TLS version except the newest isn't automatically the right call for every site. A small population of genuinely old clients — outdated Android versions, old embedded devices, some corporate environments stuck on legacy software — may not support TLS 1.3 or even 1.2 in some rare cases. Restricting SSLProtocol to only the newest versions is the right default for most sites today, but it's a real trade-off between security posture and compatibility, not a setting with no downside at all — worth a deliberate decision based on who actually needs to reach the site, not just applied reflexively.

Hands-On Exercises

Exercise 1

Write an SSLProtocol line that disables every protocol version except TLS 1.2 and TLS 1.3, using the fail-safe pattern this chapter recommends rather than a positive-only list.

📄 View solution
Exercise 2

Explain, in your own words, what problem OCSP stapling actually solves, and specifically what changes about who contacts the certificate authority, and when, once stapling is enabled.

📄 View solution
Exercise 3

A junior admin proposes restricting SSLProtocol to TLS 1.3 only, on every site the company runs, "for maximum security." Using this chapter's own warning box, explain what real trade-off this decision involves, and what question should actually be asked before applying it everywhere.

📄 View solution

Chapter 6 Quick Reference

  • Modern SSLCertificateFile can hold the full chain in one file since Apache 2.4.8 — SSLCertificateChainFile is mostly legacy now
  • SSLProtocol — use -all +TLSv1.2 +TLSv1.3 (deny-then-allow), not a positive-only list, to fail safe against future protocol additions
  • SSLCipherSuite/SSLHonorCipherOrder — curate and enforce cipher choice, mainly relevant pre-TLS 1.3
  • OCSP stapling — the server, not the client, fetches and caches proof of certificate validity, then attaches it to the handshake directly
  • Restricting TLS versions is a real security/compatibility trade-off, not a setting to maximize without checking who still needs to connect