Skip to content
MtrXTools

SSL_do_handshake() failed while SSL handshaking to upstream

nginx couldn't complete TLS with the backend

Seen in nginx error log with proxy_pass https://

The TLS handshake between nginx and an HTTPS backend failed, so nginx could not forward the request.

Common causes

  • nginx does not send SNI to the backend by default, and the backend (often a CDN or shared host) needs it.
  • nginx and the backend have no TLS version or cipher in common.
  • Without "to upstream" in the line, it is a client failing to handshake with nginx, often scanners or very old clients.

How to fix it

  1. Send SNI: proxy_ssl_server_name on; (and proxy_ssl_name if the backend expects a different name).
  2. Align versions with proxy_ssl_protocols TLSv1.2 TLSv1.3; if the backend needs them.
  3. Check the backend with an SSL test on host:port to see the versions and certificate it offers.
Check the backend TLS setup

Got a different message? Paste it into the error explainer.

Related errors

All 19 Web servers & certificates errors