curl: (35) SSL connect error
The TLS handshake failed
Seen in curl, libcurl (CURLE_SSL_CONNECT_ERROR), Git, PHP
curl opened the TCP connection but the TLS handshake with the server failed.
Common causes
- No shared TLS version or cipher suite, often an old curl or OpenSSL against a TLS 1.2 or 1.3 only server, or the reverse.
- A firewall, proxy or TLS-inspecting device reset the connection during the handshake (SSL_ERROR_SYSCALL).
- The server requires SNI or a client certificate, or the port does not speak TLS at all.
- On Windows, Schannel could not check revocation or rejected the server chain.
How to fix it
- Read the text after "(35)"; it usually names the real cause, such as an alert or SSL_ERROR_SYSCALL.
- Run curl -v to see how far the handshake got, and test with openssl s_client -connect host:443 -servername host.
- Update curl and its TLS library, and check which TLS versions the server accepts.
- Test from outside the corporate network to rule out an intercepting proxy.
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
- sslv3 alert handshake failure · The server rejected the TLS handshake
- 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