Hosting & Deployment

TLS Certificates and HTTPS Operations

Manage TLS certificates, private keys, renewal automation, HTTPS redirects, and certificate troubleshooting on Linux web servers.

TLS protects data in transit and allows visitors to verify that they are connecting to the intended domain. Operating HTTPS requires more than obtaining a certificate: administrators must protect private keys, renew certificates before expiry, configure the correct names, and test the full chain from a client perspective.

Plan certificate coverage

List every hostname that should work, including www, application subdomains, and any API host. A certificate for example.com does not automatically cover www.example.com unless the latter is included as a subject alternative name or covered by a suitable wildcard. Wildcard certificates require DNS-based validation and careful control of DNS credentials.

Inspect the certificate and chain

Useful OpenSSL checks include:

openssl s_client -connect example.com:443 -servername example.com </dev/null
openssl x509 -in fullchain.pem -noout -subject -issuer -dates

The server should present the leaf certificate and required intermediate certificates. Protect the private key with restrictive filesystem permissions and never place it in a public document root or source repository.

Automate renewal and verify it

Use the certificate authority's supported ACME client or the hosting panel's certificate automation. Confirm that renewal can complete, that HTTP or DNS validation remains available, and that the web server reloads the renewed certificate. A successful renewal command is not enough; test the live endpoint afterward.

Redirects, mixed content, and troubleshooting

Choose one canonical hostname and redirect HTTP to HTTPS at a single clearly owned layer. Avoid redirect rules that conflict between the application, CDN, proxy, and web server. Update absolute asset URLs and callback URLs to HTTPS to eliminate mixed content. When a browser reports a certificate error, check hostname mismatch, expiry, chain completeness, SNI, and whether a CDN is presenting a different certificate.

Keep a renewal alert and an inventory of certificate owners. For cPanel environments, use AutoSSL or the supported WHM workflow and avoid manually replacing panel-managed certificate files.

Share this page Help other developers discover this resource.