Black Friday: 60% off yearly plans with code BF2026, until November 30. See the deal

Troubleshooting

SSL handshake failed: what causes it and how to fix it

An SSL/TLS handshake fails when the client and server cannot agree on how to secure the connection: no shared protocol version or cipher, a certificate the client cannot verify, or a missing server name (SNI). The TLS alert in the log or error text, such as handshake_failure or unknown_ca, shows which one.

The short answer
  • The handshake negotiates version, cipher and certificate. A failure in any of the three ends the connection.
  • openssl s_client reproduces the failure and prints what the server sent.
  • Match the TLS alert name to the cause before changing any configuration.
Try the ssl certificate checkerFree, live, no signup

Which TLS alert means what?

TLS alerts commonly seen when a handshake fails (RFC 8446 alert values)
Alert (value)Typical meaning in practiceFirst check
handshake_failure (40)No acceptable parameters, such as no shared cipher suiteServer cipher list and enabled protocols
protocol_version (70)No shared protocol versionEnable TLS 1.2 and 1.3; remove obsolete versions
insufficient_security (71)Client offers only weaker parameters than the server acceptsUpdate the client or relax the server offering to a modern set
unknown_ca (48)The peer does not trust the issuerChain completeness, CA bundle on the client
bad_certificate (42)The certificate was rejectedName match, signature, validity
certificate_expired (45)A certificate is outside its validity periodRenew and redeploy
unrecognized_name (112)The requested server name is not knownSNI value and virtual host config

Alert names and numeric values from the AlertDescription enum in RFC 8446. The "typical meaning" column is practical guidance, not the RFC text.

How do you diagnose a failed handshake?

  1. 01

    Reproduce with OpenSSL

    Run openssl s_client with -connect and -servername. If SNI is omitted for an IP address, the server may return a different certificate or reject the request.

  2. 02

    Try each version

    Run once with -tls1_2 and once with -tls1_3 to see which the server accepts.

  3. 03

    Add verification

    Use -verify_return_error so a certificate problem aborts the handshake instead of only printing a warning.

  4. 04

    Read the server error log

    It usually records the same alert or the reason it rejected the client hello.

  5. 05

    Check the layer in front

    A CDN, load balancer or WAF can negotiate differently from the origin, so test the public name and the origin separately.

Which commands reproduce it?

OpenSSL s_client
# Basic test with SNI
openssl s_client -connect example.com:443 -servername example.com

# Fail hard on certificate errors
openssl s_client -connect example.com:443 -servername example.com -verify_return_error

# Restrict to one protocol version
openssl s_client -connect example.com:443 -servername example.com -tls1_3

What are the most common root causes?

No common version or cipher

Older servers offering only TLS 1.0 or weak ciphers, or clients too old for TLS 1.2. See the version and cipher mismatch fix.

Untrusted or incomplete chain

The client lacks the issuing CA or the server leaves out an intermediate.

Missing or wrong SNI

Servers hosting many names pick a certificate by the SNI name sent in the client hello.

Interception by a proxy

Security software or a corporate proxy that rewrites TLS can break clients that do not trust its CA.

What should you collect before asking your host for help?

  • The exact error text and the client that produced it, with its version
  • The date, time and time zone of a failed attempt, so logs can be matched
  • The output of openssl s_client for the public hostname with -servername set
  • Results for -tls1_2 and -tls1_3 separately
  • Whether the failure happens on the origin IP, through the CDN, or both
  • Whether a recent certificate, TLS or CDN change preceded the first failure

Common questions

What does SSL handshake failed mean?

The client and server could not complete the TLS negotiation that sets up an encrypted connection. They found no shared protocol version or cipher, the client rejected the certificate, or the server could not tell which site was requested.

How do I fix SSL handshake failed on my server?

Enable TLS 1.2 and 1.3, remove obsolete versions and weak ciphers, serve the full certificate chain with the correct names, and confirm SNI works. Reproduce the failure with openssl s_client, then retest after each change.

What is SNI and why does it cause handshake errors?

Server Name Indication is the hostname the client sends during the handshake so a server hosting many sites can pick the right certificate. OpenSSL's -servername option sets it. If it is missing or wrong, the server may present another certificate or reject the connection.

Does a handshake failure always mean the certificate is bad?

No. Many failures are about protocol versions and cipher suites, not the certificate. The alert name tells you: handshake_failure and protocol_version point to negotiation, while unknown_ca, bad_certificate and certificate_expired point to the certificate.

Watch your domains automatically

Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.