Enabling HTTPS on a LiteSpeed server is straightforward. Hardening that HTTPS to the level expected of a production environment — TLS 1.3, HSTS with preload readiness, OCSP stapling, and a cipher suite that excludes weak algorithms — requires deliberate configuration that goes beyond installing a certificate. This article covers those steps for LiteSpeed Enterprise, with verification commands to confirm each layer is working before you publish the configuration to production.
How to verify
Check the current TLS configuration against a live domain:
# Protocol and cipher negotiated
openssl s_client -connect example.com:443 -tls1_3 -servername example.com 2>&1 | grep -E '(Protocol|Cipher|Verify)'
# OCSP stapling response
openssl s_client -connect example.com:443 -status -servername example.com 2>&1 | grep -A5 "OCSP Response"
# HSTS header
curl -sI https://example.com/ | grep -i strict-transport-security
# Certificate expiry
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null | openssl x509 -noout -dates
# TLS grade via external tool
curl -s "https://api.ssllabs.com/api/v3/analyze?host=example.com&startNew=on" | python3 -m json.tool | grep grade
After applying HSTS:
curl -sI https://example.com/ | grep -i strict-transport-security
# Expected: strict-transport-security: max-age=31536000; includeSubDomains; preload
What’s happening
LiteSpeed handles TLS at the listener level, not at the vhost level (though vhost-level overrides are possible). A single HTTPS listener can serve multiple domains via SNI (Server Name Indication), using a different certificate for each. TLS configuration is applied to the listener first and can be overridden per vhost as needed.
HSTS (HTTP Strict Transport Security) instructs browsers to refuse HTTP connections to the domain for a specified duration after the first HTTPS connection. It is sent as a response header. Once a browser has seen an HSTS header, it will not make a plain HTTP connection to that domain for the duration of max-age, even if the user types http://. The includeSubDomains directive extends this to all subdomains. The preload directive signals that the domain is submittable to the browser preload list — but actual submission to the list is a separate step you do at hstspreload.org.
OCSP stapling addresses the privacy and latency problem of certificate revocation checking. Without it, when a browser connects to your site, it must contact the CA’s OCSP responder to verify the certificate has not been revoked — a round-trip to a third-party server that adds latency and leaks the user’s browsing activity to the CA. With OCSP stapling, the server fetches and caches the OCSP response itself, then staples it to the TLS handshake. The browser gets revocation status without making a separate request. LiteSpeed supports OCSP stapling natively; it must be explicitly enabled.
Cipher suites define which cryptographic algorithms are accepted during TLS negotiation. Modern configurations should accept only ciphers from the ECDHE and DHE key exchange families (which provide forward secrecy) and should exclude known-weak algorithms like RC4, 3DES, and export ciphers. For TLS 1.3, the cipher list is fixed and you cannot configure it — TLS 1.3 only supports five strong cipher suites by design. For TLS 1.2 (needed for compatibility with older clients), a curated cipher list keeps the connection secure.
The procedure
1. Install the certificate.
On a cPanel server, Let’s Encrypt certificates are managed through AutoSSL. Confirm AutoSSL has run and the certificate is installed:
/usr/local/cpanel/bin/autossl_check --output=json 2>/dev/null | python3 -m json.tool | grep -E '(domain|ssl_status)'
ls /etc/letsencrypt/live/example.com/
For manually installed certificates, use WHM’s SSL/TLS → Install an SSL Certificate on a Domain.
2. Enable TLS 1.2 and 1.3 only — disable older versions.
In the LiteSpeed admin console at port 7080, go to Configuration → Listeners → Your HTTPS Listener → SSL. Set:
- SSL Protocol:
TLSv1.2, TLSv1.3
Or in /usr/local/lsws/conf/httpd_config.conf:
listener HTTPS {
address *:443
secure 1
keyFile /etc/letsencrypt/live/example.com/privkey.pem
certFile /etc/letsencrypt/live/example.com/fullchain.pem
sslProtocol 24
# 24 = TLSv1.2 (8) + TLSv1.3 (16)
}
Restart LSWS and verify with openssl s_client:
openssl s_client -connect example.com:443 -tls1 -servername example.com 2>&1 | grep "handshake failure"
# Should return handshake failure (TLS 1.0 rejected)
openssl s_client -connect example.com:443 -tls1_3 -servername example.com 2>&1 | grep "Protocol"
# Should return TLSv1.3
3. Configure the cipher suite for TLS 1.2.
In the SSL section of the listener or vhost, set:
ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
This list is aligned with the Mozilla Modern compatibility guideline. All entries use ECDHE or DHE key exchange, providing forward secrecy.
4. Enable OCSP stapling.
In the listener SSL configuration:
enableStapling 1
ocspRespMaxAge 86400
For the stapling to work, lshttpd must be able to reach the CA’s OCSP responder URL (embedded in the certificate). Test outbound connectivity:
openssl s_client -connect example.com:443 -status -servername example.com 2>&1 | grep -A5 "OCSP Response Status"
# Expected: OCSP Response Status: successful (0x0)
Allow up to 5 minutes after enabling stapling for the server to fetch and cache the OCSP response.
5. Add the HSTS header.
In LiteSpeed, HSTS is configured as a response header in the vhost or server configuration. In the admin console, go to Configuration → Virtual Hosts → Your Vhost → Rewrite and add:
RewriteEngine on
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
Or in the vhost configuration file:
addDefaultCharset off
rewrite {
rules <<<END_rules
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
END_rules
}
Start with max-age=300 (5 minutes) and verify the header appears before increasing to 31536000 (one year). Once HSTS is set to one year with preload, it is very difficult to undo safely.
6. Verify the complete configuration.
# Protocol
openssl s_client -connect example.com:443 -tls1_3 -servername example.com 2>&1 | grep Protocol
# OCSP
openssl s_client -connect example.com:443 -status 2>&1 | grep "OCSP Response Status"
# HSTS
curl -sI https://example.com/ | grep -i strict
# Cipher
openssl s_client -connect example.com:443 -servername example.com 2>&1 | grep Cipher
Common pitfalls
Setting HSTS on a domain that still serves HTTP. If any subdomain or path still responds over HTTP — even with a redirect — setting includeSubDomains on an HSTS header will break those connections for users who have cached the HSTS policy. Ensure every subdomain covered by includeSubDomains has a valid certificate before setting the directive.
OCSP stapling failing silently due to blocked outbound connections. Firewalls on hosting servers sometimes block outbound HTTP on port 80, which is the port used by most OCSP responders. If lshttpd cannot reach the OCSP URL, stapling is skipped without error — the connection still works, but revocation is not checked efficiently. Test with curl http://ocsp.sectigo.com/ from the server. If it times out, whitelist that OCSP URL in the outbound firewall.
Incorrect sslProtocol bitmask value. LiteSpeed encodes the protocol as a bitmask: TLSv1.0 = 1, TLSv1.1 = 2, TLSv1.2 = 4, TLSv1.3 = 8. Wait — the actual values differ by configuration version. Always verify by testing with openssl s_client -tls1 after making changes, rather than trusting the bitmask value alone.
Certificate chain incomplete. The certFile should point to fullchain.pem, not just cert.pem. If the intermediate CA certificate is missing, the TLS handshake fails for clients that do not have the intermediate cached. OCSP stapling also requires the full chain to function. Run openssl verify -CAfile /etc/ssl/certs/ca-certificates.crt /etc/letsencrypt/live/example.com/fullchain.pem to confirm the chain verifies cleanly.
Preloading HSTS without understanding the consequences. Submitting a domain to the HSTS preload list makes it hardcoded into Chrome, Firefox, and Safari. Removing it requires a pull request to the preload list maintainers and takes months to propagate. Do not add the preload directive unless the domain will permanently serve HTTPS, including all subdomains, with no exceptions.
Stack Harbor audits TLS configuration as part of security hardening under managed cloud operations. If you need a documented TLS posture review — cipher suites, HSTS readiness, OCSP stapling verification — the knowledge base has the relevant security runbooks.