Node.js app logs `Error: unable to verify the first certificate` calling an internal API.
IntermediateTroubleshootingTLS and certificate errors
Answer
Likely causes → The internal API serves a leaf without its intermediate, or is signed by a private CA Node doesn't know (Node ships its own CA list).
Diagnose →
openssl s_client -connect internal-api:443 -servername internal-api -showcerts </dev/null
Fix → Serve the full chain on the API, or start Node with NODE_EXTRA_CA_CERTS=/etc/ssl/private-ca.pem. Avoid NODE_TLS_REJECT_UNAUTHORIZED=0.
Prevent → Issue internal certs from a CA whose root is distributed to all images.
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