Interview Prep/DevSecOps/Certificates, TLS and security incident response

A client calling an mTLS-protected internal API gets `400 Bad Request: No required SSL certificate was sent` from nginx

BeginnerTroubleshootingCertificates, TLS and security incident response
Answer

Likely causes → nginx has ssl_verify_client on, and the client did not present a certificate. Either it is not configured with one, or the certificate it has was not issued by a CA in ssl_client_certificate, so the client never offers it.

Diagnose →

curl -v --cert client.crt --key client.key --cacert ca.crt https://internal-api.acme.com/health
openssl s_client -connect internal-api.acme.com:443 -servername internal-api.acme.com </dev/null | grep -A5 "Acceptable client certificate CA names"

Fix → Configure the client with a certificate and key issued by a CA nginx trusts. If the client CA was rotated, add the new CA to the bundle in ssl_client_certificate.

Prevent → Issue client certificates automatically (cert-manager or a service mesh) with short lifetimes, and monitor expiry on both sides.

All DevSecOps questions

More on Certificates, TLS and security incident response