SSL certificates

Configure TLS versions and cipher suites on Nginx and Apache

Which TLS versions to allow, what cipher suites and forward secrecy mean, recommended Nginx and Apache settings, and how to test your server's TLS configuration.

AdvancedLinux VPS2 min read

An SSL certificate is only half of HTTPS security. The TLS versions and cipher suites your server allows decide how strong the encryption really is and which old clients can connect. This guide explains the choices and gives safe settings for Nginx and Apache.

Before you start

  • A Linux server with Nginx or Apache and a working certificate.
  • A reasonably recent OpenSSL (1.1.1 or 3.x) for TLS 1.3 – check with openssl version.

TLS versions

VersionStatusRecommendation
SSL 2.0 / 3.0BrokenDisable
TLS 1.0 / 1.1Deprecated (RFC 8996), unsupported by modern browsersDisable
TLS 1.2Secure with modern ciphersEnable
TLS 1.3Fastest and most secure; fewer round tripsEnable

Cipher suites in brief

A cipher suite combines a key exchange, an authentication method, a bulk cipher and a hash. Good choices for TLS 1.2 use:

  • ECDHE key exchange for forward secrecy – stolen keys can't decrypt past traffic.
  • AES-GCM or ChaCha20-Poly1305 authenticated encryption.

Avoid RC4, 3DES, CBC-mode suites where possible, static RSA key exchange and anything with NULL or EXPORT. TLS 1.3 has its own short list of strong suites and needs no tuning.

Nginx configuration

In the http block or each HTTPS server block:

ssl_protocols TLSv1.2 TLSv1.3;
ssl_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;
ssl_prefer_server_ciphers off;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1d;
ssl_session_tickets off;

Test and reload: sudo nginx -t && sudo systemctl reload nginx.

Apache configuration

In the SSL config (for example /etc/apache2/mods-available/ssl.conf or /etc/httpd/conf.d/ssl.conf):

SSLProtocol -all +TLSv1.2 +TLSv1.3
SSLCipherSuite 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
SSLHonorCipherOrder off
SSLSessionTickets off

Test and reload: sudo apachectl configtest && sudo systemctl reload apache2 (or httpd).

Tip: Mozilla's SSL Configuration Generator produces up-to-date "intermediate" and "modern" configs for your exact server and OpenSSL versions.

On AlmaLinux and Rocky: system crypto policies

RHEL-family systems apply a system-wide policy. Check it with update-crypto-policies --show; DEFAULT already disables TLS 1.0/1.1. Settings in your web server config can narrow it further.

Test your configuration

  • Check a specific version: openssl s_client -connect example.com:443 -tls1_1 should fail; -tls1_3 should succeed.
  • Use an online SSL server test or the open-source testssl.sh for a full report on protocols, ciphers and known weaknesses.

Troubleshooting

  • Old devices can't connect: very old Android or Windows versions lack TLS 1.2; decide whether you must support them.
  • Changes don't apply: another server block or virtual host (often the default one) overrides settings; set them globally.
  • TLS 1.3 missing: OpenSSL or the web server is too old.

FAQ: TLS versions and ciphers

Is TLS 1.2 still safe?

Yes, with ECDHE and AEAD ciphers. Keep it enabled alongside TLS 1.3 for compatibility.

What is forward secrecy?

Each session uses temporary keys, so even if the server's private key leaks later, recorded past traffic stays protected.

Do I need to configure this on cPanel hosting?

No. The host manages TLS settings on shared servers.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.