sslv3 alert handshake failure
The server rejected the TLS handshake
Seen in OpenSSL, curl, wget, Python ssl, PHP, nginx logs (SSL alert number 40)
The other side sent a handshake_failure alert (alert 40): it could not agree on TLS settings with this client.
Common causes
- No cipher suite or TLS version in common, typically an outdated client against a modern server, or the reverse.
- SNI missing, for example connecting by IP or with an old tool, so the server has no matching certificate to offer.
- The server requires a client certificate and none, or the wrong one, was sent.
- The server only has an ECDSA or RSA certificate type the client does not support.
How to fix it
- Test with openssl s_client -connect host:443 -servername host and add -tls1_2 or -tls1_3 to find what works.
- Update the client OpenSSL, language runtime or OS so it supports TLS 1.2 and 1.3 with modern ciphers.
- If mutual TLS is required, pass the client certificate and key (curl --cert and --key).
- Check which TLS versions and ciphers the server offers.
Got a different message? Paste it into the error explainer.
Related errors
- unable to get local issuer certificate · The client can't find the certificate's issuer
- unable to verify the first certificate · The intermediate certificate is missing
- certificate has expired · The server certificate has expired
- self signed certificate in certificate chain · The chain ends in an untrusted root
- curl: (51) SSL: no alternative certificate subject name matches target host name · The certificate doesn't match the hostname
- curl: (35) SSL connect error · The TLS handshake failed
- tlsv1 alert protocol version · The peer does not accept this TLS version
- tlsv1 alert unknown ca · The peer doesn't trust the certificate's CA
- no peer certificate available · The handshake failed before a certificate arrived
- Unable to establish SSL connection. · wget could not complete the TLS handshake
- ERROR: cannot verify example.com's certificate · wget doesn't trust the server's certificate
- Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames · The certificate doesn't cover this hostname