[Fixed] SSL_do_handshake() failed (SSL: error:0A00010B:SSL routines::wrong version number) while SSL handshaking to upstream nginx-proxy – Nginx

by
Ali Hasan
amazon-ec2 boot2docker docker-compose jwilder-nginx-proxy nginx

Quick Fix: 1. Change your proxy_pass directive to use HTTP instead of HTTPS.
2. Avoid using the same names (www.api.coinhexa.com) on both :s and server_names to prevent confusion and potential issues.

The Problem:

SSL handshake is failing while trying to establish a connection to the Nginx proxy server due to a mismatch in SSL versions. The error message indicates that the client is using a different version of SSL than the server, resulting in the "wrong version number" error.

The Solutions:

Solution 1: Use HTTP in proxy_pass directive

This error can be resolved by changing the proxy_pass directive in the nginx configuration file to use HTTP instead of HTTPS.

Currently, the proxy_pass directive is configured as follows:

proxy_pass https://www.api.coinhexa.com;

However, the upstream server is an HTTP endpoint. To fix this, change the directive to:

proxy_pass http://www.api.coinhexa.com;

This will ensure that nginx uses HTTP to communicate with the upstream server, resolving the version number mismatch error.

Q&A

I am getting a weird nginx issue which says: SSL_do_handshake() failed (SSL: error:0A00010B:SSL routines::wrong version number) while SSL handshaking to upstream nginx-proxy

Possible cause is the proxy_pass setting in your nginx config. Verify that the proxy_pass URL is using the correct protocol (HTTP or HTTPS) and the upstream server is accessible on that protocol.