Skip to content

When a browser, an API client or a mobile app shows "SSL handshake failed", it is telling you that two machines tried to agree on how to talk securely and gave up. The message sounds frightening, but it is usually specific and fixable once you know which step broke. This guide explains what the handshake actually does, lists the most common causes in the order you should check them, and gives a repeatable way to diagnose the problem without guessing.

Note that "SSL" is the old name. Modern connections use TLS, and certificates are still called SSL certificates in everyday speech. The two terms appear together in error messages, so this article uses them loosely, but the protocol on the wire today is TLS.

What happens during a handshake

Before any web page or API data is sent, the client and the server run a short negotiation. In simplified form it works like this:

  1. The client sends a hello message listing the TLS versions and cipher suites it supports, plus the server name it wants to reach (this is called Server Name Indication, or SNI).
  2. The server chooses a version and cipher suite that both sides support, and sends its certificate chain.
  3. The client checks the certificate: is it signed by a trusted authority, is it within its validity dates, and does it cover the host name being requested.
  4. The two sides derive shared keys. In TLS 1.3 this is done with an ephemeral key exchange, so each session gets fresh keys.
  5. Both sides confirm that the handshake was not tampered with, and encrypted data starts to flow.

A failure can occur at any of these points. The client or server then sends an alert such as handshake_failure, protocol_version, unknown_ca, certificate_expired or bad_certificate, and closes the connection. The alert name is the single most useful clue you have, so always try to see it rather than relying on a generic browser page.

The seven most common causes

Check these in roughly this order.

Cause 1: expired or not yet valid certificates

Every certificate has a "not before" and a "not after" date, defined in the X.509 profile described in RFC 5280. If the client's clock falls outside that window, validation fails. Most often the certificate has simply expired because renewal was forgotten or an automatic job stopped working. Setting up monitoring, as described in how to check SSL expiry automatically, removes this whole class of incident.

A less obvious variant is the wrong clock on the client. An old phone, a virtual machine restored from a snapshot or a device with a dead clock battery may believe it is a different year. Every certificate then looks expired or not yet valid. If only one device fails while everyone else connects fine, check its date and time first.

Cause 2: host name mismatch

The client verifies that the name it requested appears in the certificate, either as the common name or, more importantly, in the Subject Alternative Name list. Typical mismatches are:

  • A certificate issued for example.com but used on www.example.com, which was not included.
  • A wildcard certificate for *.example.com used for example.com itself or for a deeper name such as a.b.example.com. A wildcard covers one label only.
  • Accessing the server by IP address when the certificate lists only names.
  • A shared server that returns a default certificate because it did not receive or understand SNI.

The last case is subtle. If a very old client does not send SNI, a server hosting several sites may answer with the wrong certificate. The cure is to test with a client that sends SNI, and to review the default virtual host on the server.

Cause 3: incomplete or wrong certificate chain

Your certificate is normally signed by an intermediate authority, which in turn is signed by a root that clients already trust. The server must send the leaf certificate plus the intermediates. If the intermediate is missing, some clients (browsers that cache intermediates, for example) may still succeed, while others such as command-line tools, Java applications or older Android versions fail with unknown_ca or "unable to get local issuer certificate".

This is why a site can "work in my browser" yet fail for a partner's integration. When you install a certificate, use the full chain file provided by the authority, not only the single certificate file. If you recently changed certificates, the guide to replacing an SSL certificate without taking the site down shows how to stage the new chain safely and check it before switching traffic.

Cause 4: protocol version or cipher mismatch

Servers and clients each support a range of TLS versions. Security best practice has retired SSL 3.0, TLS 1.0 and TLS 1.1, and many servers now accept only TLS 1.2 and TLS 1.3. Two situations cause failures:

  • An old client (a legacy application, an unsupported operating system or an embedded device) offers only versions the server has disabled.
  • A server was hardened aggressively and now offers a cipher list that does not overlap with what some clients support.

The server alert here is usually protocol_version or handshake_failure. Resist the urge to turn old protocols back on for everybody. A better approach is to identify which client needs them, decide whether that client can be upgraded, and only then consider an exception with a clear plan to remove it. Remember that compatibility settings are a trade-off between reach and security, and the right answer depends on who your users are.

Cause 5: client certificate and mutual TLS problems

In most websites only the server proves its identity. In mutual TLS, used by some APIs and private networks, the server also demands a certificate from the client. If the client does not send one, sends an expired one or sends one signed by an authority the server does not trust, the handshake fails with bad_certificate or certificate_required. If you do not intentionally use mutual TLS but see these alerts, a server setting may be requiring client certificates by mistake.

Cause 6: network devices and proxies in the middle

Firewalls, corporate inspection gateways, antivirus software and some proxies can intercept TLS. When they do, the client sees a certificate issued by the inspecting device. If that device's authority is not trusted by the client, the handshake fails. Conversely, a firewall may block the connection or reset it during the hello message, which looks like "connection reset" instead of a clean TLS alert.

Clues that a middle device is involved:

  • The error appears only on one network (an office or a hotel) and disappears on a mobile connection.
  • The certificate shown to the client has an unexpected issuer name.
  • The failure is a reset or timeout, not a TLS alert.

If you use a forward proxy for lawful testing or automation, remember that the proxy may need to be configured for HTTPS tunnelling (the CONNECT method), and the target site's certificate is still verified by your client. Always respect the terms of the sites you reach and local law when you use such tooling.

Cause 7: server-side configuration and resource problems

Sometimes the certificate and protocols are fine, but the server itself misbehaves:

  • The private key file does not match the installed certificate, often after mixing files from different requests.
  • The certificate file is unreadable because of permissions, or the web server was not reloaded after the change.
  • The server listens on the HTTPS port but is configured for plain HTTP, or the reverse. A client speaking TLS to a plain HTTP port will fail immediately.
  • A load balancer or CDN terminates TLS with its own certificate, and the origin certificate behind it is invalid or missing.
  • The server is overloaded and drops new connections before the handshake finishes.

Check the web server error log. It often states the problem plainly, such as a key mismatch or a missing file.

A repeatable diagnosis routine

Follow the same order every time, so you do not jump between theories.

  1. Reproduce and capture the exact message, the time, the client type and the network you were on.
  2. Try a second client and a second network. If only one combination fails, the cause is local to that client or path.
  3. Check dates: the certificate validity and the client clock.
  4. Check the name: does the requested host name appear in the certificate?
  5. Check the chain: does the server send the intermediates?
  6. Check protocol versions and ciphers on the server against what the failing client supports.
  7. Check the server log and configuration for key mismatches or reload problems.
  8. Only then consider changing or reissuing the certificate.

For the command line, openssl s_client -connect example.com:443 -servername example.com prints the certificate chain, the negotiated protocol and any alert. Adding -tls1_2 or -tls1_3 lets you test one version at a time. curl -v https://example.com shows a readable summary of the same steps. Compare the output from a working and a failing machine, because the difference is usually the answer.

Worked example

Suppose a partner reports that your API returns "SSL handshake failed" from their Java service, while your own browser loads the same address without problems. You follow the routine. The date and name checks pass. The chain check reveals that the server sends only the leaf certificate. Browsers fetch the missing intermediate on their own, but the Java client does not. You install the full chain file, reload the web server, and re-run the openssl command, which now shows two certificates in the chain. The partner retries and connects. Total cause: one missing file, found in minutes because you followed the order rather than reissuing the certificate.

A second example: users on a single office network cannot open your site, but home users can. The certificate they see names a security appliance as issuer. The fix lies with that office's IT team, who must either exempt your domain from inspection or distribute the appliance's authority to their devices. Nothing is wrong on your server.

Limits and what to watch for

  • Do not weaken settings just to make an error disappear. Enabling obsolete protocols or skipping certificate verification in code removes the protection that TLS provides.
  • If you enforce HSTS, a broken certificate becomes a hard failure that visitors cannot click through. Read HSTS setup precautions before enabling it, and test certificates thoroughly first.
  • Caches matter. After fixing a chain or certificate, some clients, load balancers and CDNs hold the old version for a while. Test against the actual endpoint, not a cached path.
  • Fixes on the server cannot repair a wrong client clock or an untrusted inspection device. Be ready to explain this clearly to the affected user.
  • Error text differs between browsers, libraries and operating systems. The same underlying alert may be shown with different words, so rely on the alert name from a tool when you can.
  • Document what you changed. A short note of the cause and the fix saves hours the next time the same alert appears.

If you are choosing or renewing certificates, a reputable provider will deliver the chain files, support modern validation methods and give you clear instructions for installation. Compare what is included on the product page rather than assuming, and keep an inventory of where each certificate is installed.

Summary

A failed SSL handshake means the two sides could not agree on a secure connection. The usual causes are, in rough order of frequency: expired certificates, name mismatches, missing intermediate certificates, protocol or cipher mismatches, client certificate requirements, interfering network devices and server misconfiguration. Capture the exact alert, test from a second client and network, and walk through dates, names, chain, protocols and logs in that order. Avoid weakening security to silence an error, plan certificate changes carefully, and monitor expiry so the simplest cause never surprises you. When you are ready to review certificate options for your site, the SSL page is the place to see what is available.

Frequently asked questions

What does SSL handshake failed mean?

It means the client and the server could not complete the negotiation that sets up an encrypted connection. The cause can be an expired or mismatched certificate, no shared protocol version or cipher, a missing intermediate certificate, or a network device interfering with the connection.

Is an SSL handshake failure always a problem with the certificate?

No. Certificates are a very common cause, but protocol and cipher mismatches, wrong server name handling, a wrong system clock, proxies and firewalls can all stop the handshake before or after the certificate is checked.

How can I test a handshake from the command line?

Tools such as openssl s_client and curl with the verbose option show the protocol version, the certificate chain and the exact alert the server sends. Reading that output usually points straight to the failing step.

Will reinstalling the certificate fix every handshake error?

Only if the certificate or its chain is the problem. Reinstalling without diagnosing can hide the real cause, such as a disabled protocol version or a bad virtual host, so it is better to read the error first.

About the author

Bob Kanokphon Thongdee, founder of XPASS VPN

Bob Kanokphon Thongdee

  • Founder of XPASS VPN
  • Co-founder of eSIMonline.asia
  • More than 7 years in online marketing
  • Founder of Cojourney Visa and Cojourney Travel

Need an SSL certificate?

Pick the certificate type that fits your site and see the price before you check out.

SSL from $14.99

See SSL certificates

Keep reading

SSL Guides

How to Set Up HSTS: What to Watch Out For

HSTS hardens HTTPS, but browsers remember it for a long time. Learn what the header does, how to roll it out in stages and which mistakes can lock people out.

10 min read

SSL Guides

How to Replace an SSL Certificate Without Taking Your Site Down

Replacing a certificate does not have to cause an outage. Prepare, test, switch and verify in a calm order, and keep a rollback ready.

10 min read

SSL Guides

How to Monitor SSL Certificate Expiry Automatically

Expired certificates still catch careful teams out. Learn how to read the expiry date, automate the check, route alerts and build a renewal routine that works.

10 min read