---
title: "Mutual TLS rejected: whose certificate failed, and who logs it? | Proofline"
description: "In mutual TLS both sides present certificates, so first decide whose certificate was refused: an alert your client received means the server rejected yours."
url: https://proofline.sh/learn/mtls-client-certificate-rejected/
---

[Learning center](/learn/)

# Mutual TLS rejected: whose certificate failed, and who logs it?

In mutual TLS both sides present certificates, so first decide whose certificate was refused: an alert your client received means the server rejected yours. Read the alert name, then repeat the handshake with openssl s\_client and your client certificate to see which CA names the server asks for. Compare your certificate's issuer and dates with that list.

Network outages The Proofline team November 23, 2026 6 min read

## Two directions, one failed handshake

A mutual TLS handshake has two verifications. Your client checks the server's certificate against its trust store, and the server checks your client certificate against the CA list it trusts. Either can fail, and the error text tells you which.

-   **Your client refused the server.** Your client logs a verification error, such as `unable to get local issuer certificate` or `certificate has expired`, with no "alert" in the message. The server logs that it received an alert. The server-certificate guides apply: [which certificate expired](/learn/tls-certificate-expired-dependency/).
-   **The server refused your certificate.** Your client logs an alert it received, and the server's log holds the reason. The rest of this guide covers that case.

OpenSSL records an alert reason when the alert arrives from the peer, so a client-side error that names an alert means the server sent it. [OpenSSL alert handling](https://github.com/openssl/openssl/blob/openssl-3.0/ssl/record/rec_layer_s3.c)

## What each alert says about your certificate

RFC 8446 defines the alerts a server sends when it refuses a client certificate. OpenSSL clients print them as shown. [RFC 8446 alert descriptions](https://www.rfc-editor.org/rfc/rfc8446#section-6.2) · [OpenSSL SSL error strings](https://github.com/openssl/openssl/blob/openssl-3.0/ssl/ssl_err.c)

| Alert | OpenSSL client prints | Usual cause |
| --- | --- | --- |
| certificate\_required | tlsv13 alert certificate required | Client sent no certificate (TLS 1.3) |
| unknown\_ca | tlsv1 alert unknown ca | Issuer not in the server's CA list |
| certificate\_expired | sslv3 alert certificate expired | Client certificate outside its dates |
| bad\_certificate | sslv3 alert bad certificate | Corrupt, bad signature, or rejected |

`certificate_required` is sent when a client certificate is desired but none was provided. A TLS 1.3 server that receives an empty certificate may continue without client authentication or abort with that alert, and one that finds the chain unacceptable may continue or abort. A client sends no certificate when it has none configured, when its key and certificate do not load, or when none of its certificates was issued by a CA the server named. [RFC 8446 client Certificate](https://www.rfc-editor.org/rfc/rfc8446#section-4.4.2.4)

In TLS 1.3 the client sends its certificate in its final handshake flight, together with its first application data. A refusal can therefore surface on the first read after connect, so a library may report it as a read error. [RFC 8446 handshake overview](https://www.rfc-editor.org/rfc/rfc8446#section-2)

Some servers finish the handshake and refuse at the HTTP layer instead. nginx records the result in `$ssl_client_verify` as `SUCCESS`, `FAILED:` with a reason, or `NONE`, and defines status 495 for a verification error and 496 when no certificate was presented. An Application Load Balancer in verify mode writes `tls_verify_status` to its connection log as `Success` or `Failed:` with a code such as `ClientCertExpired`, `ClientCertNotYetValid` or `ClientCertUntrusted`. [nginx ssl module](https://nginx.org/en/docs/http/ngx_http_ssl_module.html) · [ALB connection logs](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-connection-logs.html)

## See what the server asks for

In TLS 1.2 the CertificateRequest message carries a list of acceptable CA distinguished names. In TLS 1.3 the server may send the same information in a `certificate_authorities` extension, and the client should send a chain that includes one of them. [RFC 5246 CertificateRequest](https://www.rfc-editor.org/rfc/rfc5246#section-7.4.4) · [RFC 8446 certificate\_authorities](https://www.rfc-editor.org/rfc/rfc8446#section-4.2.4)

s\_client prints that list after the handshake, under `Acceptable client certificate CA names`, or prints `No client certificate CA names sent`. Run it with the certificate and key your service uses, read from the service's configured paths. `-cert` and `-key` present them when the server asks. [openssl s\_client](https://docs.openssl.org/3.0/man1/openssl-s_client/) · [s\_client CA names output](https://github.com/openssl/openssl/blob/openssl-3.0/apps/lib/s_cb.c)

```
openssl s_client -connect ledger.example.internal:443 -servername ledger.example.internal \
  -cert /etc/checkout/tls/client.crt -key /etc/checkout/tls/client.key \
  </dev/null 2>&1 | sed -n '/client certificate CA names/,/^---/p'

openssl s_client -connect ledger.example.internal:443 -servername ledger.example.internal \
  -cert /etc/checkout/tls/client.crt -key /etc/checkout/tls/client.key \
  </dev/null 2>&1 | grep -E 'alert|Verify return code'
```

The private key stays on the host; s\_client reads it the way the service does. Then inspect the certificate itself: [openssl x509](https://docs.openssl.org/3.0/man1/openssl-x509/)

```
openssl x509 -in /etc/checkout/tls/client.crt -noout -subject -issuer -dates -ext extendedKeyUsage
```

Compare its issuer with the CA names list, its dates with the current time, and its extended key usage with what client authentication needs: a certificate whose extended key usage lacks client authentication can be refused as unsuitable for that purpose. [OpenSSL X509\_V\_ERR\_INVALID\_PURPOSE](https://docs.openssl.org/3.0/man3/X509_STORE_CTX_get_error/)

An empty CA list does not prove the server accepts anything. nginx sends the certificates from `ssl_client_certificate` and not those from `ssl_trusted_certificate`, and an Application Load Balancer advertises its CA subject names only when that option is turned on. [nginx ssl\_client\_certificate](https://nginx.org/en/docs/http/ngx_http_ssl_module.html) · [ALB mutual authentication](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/mutual-authentication.html)

## Read the result

| Observation | Points to |
| --- | --- |
| certificate\_required, client has a certificate configured | Client did not send it: path, key or CA filter |
| unknown\_ca, issuer not in the CA names list | Wrong issuing CA, or the server's CA list changed |
| unknown\_ca, issuer in the list | Intermediate missing from the client's chain |
| certificate\_expired, client certificate dates current | Server clock or an expired intermediate |
| Verify error with no alert on the client | Your client refused the server's certificate |

## A worked example with two outcomes

This example is illustrative. `checkout` calls the internal ledger API with mutual TLS. At 09:00 UTC every call fails.

In the first outcome, `checkout` logs `tlsv1 alert unknown ca`. The s\_client run lists one acceptable CA, `CN=Example Services CA 2`. `checkout`'s certificate was issued by `CN=Example Services CA 1`. The ledger team replaced CA 1 with CA 2 in its trust file at 08:55 as part of a CA migration. `checkout` needs a certificate from CA 2, or the ledger keeps CA 1 in its list until clients move.

In the second outcome, `checkout` logs `sslv3 alert certificate expired`. The CA list names CA 1, and `checkout`'s certificate was issued by CA 1, but `openssl x509 -dates` shows it expired at 08:59. The rotation job had failed for a week without alerting anyone. The fix is renewing the client certificate and repairing the job; the ledger is behaving as configured.

## Limits

s\_client from the host uses the host's OpenSSL and the files you name. If the service loads its certificate from a secret store or a sidecar, test with the material it actually loaded, and check that the files on disk are the ones it reads. Behind a proxy that terminates TLS, the proxy is the server for this check; the backend may run its own, separate mutual TLS.

If the dates look right and the alerts still say expired or not yet valid, compare clocks on both sides: [certificate is not yet valid and clock skew](/learn/tls-certificate-not-yet-valid-clock-skew/). A version or cipher mismatch fails before certificates are exchanged: [protocol version and handshake failure](/learn/tls-protocol-version-handshake-failure/). For other layers, see the [hub for runtime dependency failures](/learn/runtime-dependency-failures/).

## Questions

### Why does the error appear on my first request and not on connect?

In TLS 1.3 the client's certificate travels in its last handshake flight. The client may consider the connection open before the server has checked the certificate, so the refusal arrives on the next read.

### Can the server tell me why it rejected my certificate?

Only through the alert, which is coarse. The server's own log, or a load balancer's connection log, names the specific reason.

### Do I need to send the intermediate with my client certificate?

If the server trusts only the root, yes: send the intermediate after your certificate, the same way a server sends its chain. s\_client takes it with `-cert_chain`.

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [TLS protocol version or handshake failure alert from a dependency](/learn/tls-protocol-version-handshake-failure/)
    
    Network outages The Proofline team November 23, 2026 5 min read
    
-   ### [Which certificate expired when a dependency call fails?](/learn/tls-certificate-expired-dependency/)
    
    Network outages The Proofline team November 23, 2026 6 min read
