A backend behind nginx (`proxy_pass https://...`) fails with `upstream SSL certificate does not match "10.0.4.12"`.
IntermediateTroubleshootingTLS and certificate errors
Answer
Likely causes → proxy_ssl_verify on with proxy_pass to an IP or upstream name, and nginx isn't sending the right SNI / verifying against the right name.
Diagnose →
grep -n -E 'proxy_ssl|proxy_pass' /etc/nginx/conf.d/*.conf
tail -n 20 /var/log/nginx/error.log
Fix →
proxy_ssl_server_name on;
proxy_ssl_name backend.internal.example.com;
proxy_ssl_trusted_certificate /etc/nginx/ca.pem;
proxy_ssl_verify on;
Prevent → Use hostnames for TLS upstreams and keep verification on.
More on TLS and certificate errors
`curl: (60) SSL certificate problem: certificate has expired`Beginner`curl: (60) SSL certificate problem: unable to get local issuer certificate`Beginner`SSL: no alternative certificate subject name matches target host name 'api.example.com'`BeginnerSome clients get the wrong certificate (another site's) from a shared IP.Intermediate`SSL routines::sslv3 alert handshake failure` from `openssl` or curl.IntermediatePython `requests` fails with `SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain`.Beginner