The short answer
Use only TLS 1.2 and TLS 1.3 with strong cipher suites, enable HSTS, and regularly test your server with public scanners. Keep libraries up‑to‑date and retire weak protocols such as SSL v2/v3 and TLS 1.0/1.1.
Why SSL/TLS matters for web servers
Encryption protects data while it moves between a visitor’s browser and your web server. Without it, anyone on the same network or a malicious intermediary can read or alter the information, exposing credentials, personal details, and business transactions. TLS creates a secure channel that encrypts each byte, ensuring that only the intended server can decrypt the content. This prevents eavesdropping, session hijacking, and data tampering, which are common attack vectors against unencrypted HTTP sites.
Beyond technical protection, TLS signals trust to users and browsers. Modern browsers display a padlock icon and may label sites without TLS as “Not Secure,” influencing visitor confidence and search rankings. A valid certificate, issued by a recognized authority, confirms the server’s identity, reducing phishing risk. By consistently presenting a secure connection, businesses demonstrate a commitment to privacy and data integrity, which is essential for maintaining customer relationships and complying with industry expectations.
How to assess your current SSL/TLS configuration
Begin by gathering information about the server's SSL/TLS setup. Use OpenSSL to connect to the web service and request the handshake details. This reveals which protocol versions (TLS 1.2, TLS 1.3, etc.) the server offers and which cipher suites are negotiated. Run the test from a machine that is not the production host to avoid impacting live traffic. Record the output for later comparison after any changes.
Next, verify the certificate chain and expiration dates. Tools such as openssl s_client or curl can display the leaf certificate, intermediate certificates, and the root authority. Check that the certificate is not expired, matches the server name, and uses a strong signature algorithm like SHA‑256. A complete chain without warnings indicates proper configuration.
- Test protocol support with
openssl s_client -connect hostname:443 -tls1_2and-tls1_3. - List supported ciphers using
openssl ciphers -v 'TLSv1.2'. - Check certificate details with
openssl s_client -connect hostname:443 -servername hostname.
openssl s_client -connect example.com:443 -servername example.com -tls1_2
openssl s_client -connect example.com:443 -servername example.com -tls1_3
openssl ciphers -v 'TLSv1.2' | head -n 10
openssl s_client -connect example.com:443 -servername example.com < /dev/null | openssl x509 -noout -dates -subject -issuerLook for the highest protocol version listed (prefer TLS 1.3 or TLS 1.2) and ensure older versions like SSL v2/v3 are not advertised. The cipher list should contain only strong suites (AES‑GCM, CHACHA20‑POLY1305) and exclude weak algorithms such as RC4 or 3DES. The certificate section must show a valid date range, correct common name, and a complete chain up to a trusted root.
Configuring a secure TLS stack
Configuring a secure TLS stack starts with disabling weak protocols and enabling only TLS 1.2 and TLS 1.3. In Apache, edit the ssl.conf file and set SSLProtocol -all +TLSv1.2 +TLSv1.3. In Nginx, add ssl_protocols TLSv1.2 TLSv1.3; to the server block. Next, choose strong ciphers. For Apache use SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH; for Nginx use ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH; and enable ssl_prefer_server_ciphers on;. Finally, enforce HSTS by adding Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" in Apache’s httpd.conf or add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; in Nginx. These settings ensure the server only speaks secure TLS and tells browsers to stick to it for a year. The preload flag allows inclusion in browser preload lists after testing.
The final step is to test the configuration. Use tools like openssl s_client -connect example.com:443 -tls1_2 and -tls1_3 to confirm the protocols are accepted. Run nmap --script ssl-enum-ciphers -p 443 example.com to list supported ciphers. Verify that HSTS is present by inspecting the response headers with curl -I https://example.com. If all checks pass, the server is ready for production traffic.
- - Keep TLS 1.0 and TLS 1.1 disabled.
- - Use only strong cipher suites that support forward secrecy.
- - Enable HSTS with a one‑year max‑age and preload flag.
# Example: enable TLS 1.2/1.3 and set ciphers in Apache
sudo sed -i 's/SSLProtocol .*/SSLProtocol -all +TLSv1.2 +TLSv1.3/' /etc/apache2/mods-available/ssl.conf
sudo sed -i 's/SSLCipherSuite .*/SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH/' /etc/apache2/mods-available/ssl.conf
# Example: add HSTS header
sudo echo 'Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"' >> /etc/apache2/conf-available/hsts.conf
sudo a2enconf hsts
sudo systemctl reload apache2Check the server logs for any TLS handshake failures and verify that browsers receive the HSTS header.
Obtaining and installing a trusted certificate
Obtaining a trusted certificate is the first step to securing your web server. For small businesses and hosting teams, the most common paths are free certificates from Let's Encrypt or paid certificates from a commercial CA such as DigiCert, Sectigo or GlobalSign. To use Let's Encrypt, you must prove control of the domain, typically by placing a special file in the web root or by responding to an HTTP challenge. Commercial CAs usually provide a CSR (certificate signing request) wizard in cPanel or a web interface; you copy the CSR, submit it, and then download the signed certificate once the CA verifies your ownership. Once you have the certificate, private key, and any intermediate certificates, you can install them safely via the control panel or by placing the files in /etc/ssl/certs and /etc/ssl/private and updating the web server configuration to point to them. Always keep a backup of the original key and certificate files before making changes, and test the configuration with a tool like openssl s_client -connect yourdomain:443 to confirm the chain is correct and no errors appear. The server should now serve HTTPS with a valid, trusted certificate, and browsers will display the padlock icon without warnings.
- Use a strong, unique private key.
- Validate domain ownership before requesting the cert.
- Keep intermediate certificates in the chain.
- Store keys securely and restrict permissions.
# Example of creating a CSR and private key for a paid cert
openssl req -new -newkey rsa:2048 -nodes -keyout mydomain.key -out mydomain.csr
# After receiving the signed cert and intermediate, install them in /etc/ssl/certs
# Verify the chain
openssl s_client -connect mydomain.com:443 -servername mydomain.com -CAfile /etc/ssl/certs/ca-bundle.crtRun a quick test: openssl s_client -connect mydomain.com:443 and check that the server sends the full chain, the certificate matches the domain, and the cipher suite is strong. If you see any errors or missing intermediates, re‑install the certificates or adjust the server configuration.
What to avoid in TLS settings
Avoiding deprecated protocols is essential for keeping a web server secure. TLS 1.0 and TLS 1.1 are no longer considered safe and should be disabled in all server configurations. Some older clients may still support them, but the risk of downgrade attacks outweighs the benefit of compatibility. Modern browsers and operating systems have already dropped support for these protocols, so disabling them will not affect legitimate traffic.
Weak cipher suites also expose servers to attacks. Disallow any cipher that uses a 40‑bit or 56‑bit key, or that relies on RC4, DES, or 3DES. Prefer authenticated encryption modes such as AES‑GCM or ChaCha20‑Poly1305. Also enable forward‑secrecy by using Diffie‑Hellman or Elliptic‑Curve Diffie‑Hellman key exchanges. Disabling these insecure options protects against known vulnerabilities and ensures data confidentiality.
- Disable TLS 1.0 and TLS 1.1
- Remove RC4, DES, 3DES and 40‑bit ciphers
- Enable only forward‑secrecy ciphers
# Example: edit Apache SSL config to disable old protocols and weak ciphers
# Open the SSL configuration file
sudo nano /etc/apache2/mods-available/ssl.conf
# Add or update the following lines
# SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
# SSLCipherSuite HIGH:!aNULL:!MD5:!3DES:!RC4
# Then reload Apache
sudo systemctl reload apache2After reloading, run a tool such as openssl s_client -connect yourdomain:443 -tls1_2 to confirm that only TLS 1.2 or TLS 1.3 is accepted and that weak ciphers are no longer negotiated.
Automating renewal and updates
Automating the renewal of SSL/TLS certificates keeps your site available without manual intervention. On a Linux VPS or cPanel server you can schedule a cron job that runs the certificate manager once a day. The job should run as root or the user that owns the web files, and it should capture output to a log file so you can verify success. A typical entry in /etc/crontab might look like this: 0 3 * * * root /usr/bin/certbot renew --quiet --deploy-hook "systemctl reload nginx" >> /var/log/certbot-renew.log 2>&1. This checks for expiring certificates at 3 a.m. and reloads the web server if a renewal occurs. Regular package updates are equally important for security. A systemd timer can be used to trigger yum or apt upgrades automatically. For example, create /etc/systemd/system/auto-update.timer with a OnCalendar=weekly entry, and point it to a unit that runs yum -y update or apt-get -y upgrade. This keeps the kernel, libraries, and web server binaries current, reducing the attack surface. Log the output to /var/log/auto-update.log and review it after each run to confirm that no critical services were restarted unexpectedly.
# Example cron entry for certbot renewal
0 3 * * * root /usr/bin/certbot renew --quiet --deploy-hook "systemctl reload nginx" >> /var/log/certbot-renew.log 2>&1
# Example systemd timer unit (auto-update.timer)
[Unit]
Description=Weekly automatic system update
[Timer]After setting up these tasks, check the log files to confirm that renewals and updates complete without errors. Look for lines indicating successful certificate renewal or package installation. If a service restart is required, verify that the web server is back online and that the new certificate is in use.
Maintaining compliance and ongoing monitoring
Regularly scanning your web server for TLS configuration weaknesses helps you stay ahead of emerging threats. Use tools such as sslscan or testssl.sh at least quarterly, or after any major software update, to verify supported protocol versions, cipher suites, and certificate validity. Record the results in a central location and compare them against your security baseline. This practice ensures that deprecated protocols like TLS 1.0 are disabled and that strong ciphers remain in use.
Log review and alerting are essential for continuous monitoring. Enable detailed TLS handshake logging in your web server (for example, Apache’s SSLCipherSuite and SSLProtocol directives) and forward those logs to a SIEM or log‑aggregation service. Set up alerts for events such as expired certificates, unexpected protocol downgrades, or sudden spikes in handshake failures. Prompt investigation of these alerts helps you detect misconfigurations or active attacks before they affect users.
- Schedule automated TLS scans weekly or after changes.
- Store scan reports in version‑controlled storage.
- Enable TLS handshake logging and forward to a log collector.
- Create alerts for certificate expiry and handshake anomalies.
sslscan -p 443 example.com # example command, read output before acting
openssl s_client -connect example.com:443 -tls1_2 # verify TLS 1.2 connectivityReview the scan output for any listed insecure protocols or weak ciphers and update your server configuration accordingly. Check the log alerts for certificate expiration warnings and handshake errors, and resolve any issues promptly.
If you would rather have engineers do this for you, see Linux server management, Windows server management or emergency malware cleanup.
Questions people ask
How can I tell if my server is still offering TLS 1.0 or 1.1?
You can check with an online SSL test or run a local scan. For example, use `openssl s_client -connect yourdomain:443 -tls1_0` and `-tls1_1` to see if the handshake succeeds. If you get a connection error, those versions are disabled. Alternatively, run `nmap --script ssl-enum-ciphers -p 443 yourdomain` to list supported protocols.
What cipher suites are considered strong for modern browsers?
Strong cipher suites for modern browsers include TLS 1.2 and TLS 1.3 suites that use forward‑secrecy: ECDHE‑RSA‑AES‑128‑GCM‑SHA256, ECDHE‑RSA‑AES‑256‑GCM‑SHA384, and the TLS 1.3 defaults like TLS_AES_128_GCM_SHA256. Avoid any suite that uses RSA key exchange or MD5/SHA‑1.
Do I need to enable HTTP Strict Transport Security (HSTS) and how?
HSTS tells browsers to only use HTTPS for your domain. Enable it by adding a header like `Strict-Transport-Security: max-age=31536000; includeSubDomains; preload` to every HTTPS response. Test the header with a browser dev tool or `curl -I https://yourdomain`. Once set, browsers will enforce HTTPS for the specified period.
How often should I renew my SSL certificate and update TLS libraries?
Certificates should be renewed before they expire, typically 90 days for free Let’s Encrypt certs or 1–2 years for commercial ones. TLS libraries and OpenSSL should be updated whenever a security patch is released. Keep a maintenance window and test the new versions on a staging server first.