Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Servers, nginx and Docker

nginx rejects a client certificate as having an unsupported purpose

Your error

client SSL certificate verify error: (26:unsupported certificate purpose)2 more lines it can show

Fix it fast

Most common cause, 1 of 3

The client certificate's extended key usage leaves out clientAuth

Issue the certificate again from your own CA with an extension file that names clientAuth.

Fix
# client.ext
keyUsage = critical, digitalSignature
extendedKeyUsage = clientAuth

openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -days 365 -extfile client.ext -out client.crt
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

nginx error (26:unsupported certificate purpose), worded unsuitable in OpenSSL 3, means one certificate in the client chain is not allowed for TLS client use. Usually the client certificate was issued for servers only and its extended key usage lacks clientAuth. Run openssl verify -purpose sslclient; the depth it prints tells you whether to reissue the leaf or a CA.

  • Applies to nginx 1.30, nginx 1.31, OpenSSL 3.0 to 4.1, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

nginx logs this at info level, below the default error level, so lower the level to see it. Then reproduce the check from the shell for the sslclient purpose. In openssl verify's output, depth 0 is the client certificate and depth 1 or more is a CA above it. OpenSSL 1.1.1 words the reason unsupported, OpenSSL 3 words it unsuitable; the number is the same.

Run this first
# server or http block:  error_log /var/log/nginx/error.log info;
sudo grep "client SSL certificate verify error" /var/log/nginx/error.log | tail -n 3
openssl verify -purpose sslclient -CAfile /etc/nginx/client-ca.crt client.crt

Then find the line you see in this list and open its fix:

  1. 1The client certificate's extended key usage leaves out clientAutherror 26 at 0 depth lookup, and the extendedKeyUsage of client.crt lists serverAuth but not clientAuth
  2. 2An intermediate or root CA carries an extended key usage without clientAutherror 26 at 1 depth lookup or higher, while the leaf itself lists clientAuth
  3. 3The key usage on the client certificate does not include a signing biterror 26 at 0 depth lookup although clientAuth is listed

What does the error look like?

  • client SSL certificate verify error: (26:unsupported certificate purpose)
  • client SSL certificate verify error: (26:unsuitable certificate purpose)
  • error 26 at 0 depth lookup: unsuitable certificate purpose

Cause 1 of 3

The client certificate's extended key usage leaves out clientAuth

You seeerror 26 at 0 depth lookup, and the extendedKeyUsage of client.crt lists serverAuth but not clientAuth

Check

Error 26 at depth 0 usually means the client certificate's extended key usage does not include clientAuth. When that extension is present, OpenSSL lets the certificate act as a TLS client only if clientAuth is in the list, so print the leaf's extensions.

Check
openssl x509 -in client.crt -noout -subject -issuer -ext extendedKeyUsage

Fix

Issue the certificate again from your own CA with an extension file that names clientAuth. Do not plan on a public web certificate for this: Let's Encrypt removed the client authentication usage from its default profile on 11 February 2026, ended its tlsclient profile on 8 July 2026, and points people who need client authentication to a private CA.

Fix
# client.ext
keyUsage = critical, digitalSignature
extendedKeyUsage = clientAuth

openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -days 365 -extfile client.ext -out client.crt

Verify

openssl verify prints client.crt: OK for the new file; install it on the client and retry.

Verify
openssl verify -purpose sslclient -CAfile /etc/nginx/client-ca.crt client.crt

Confirmed by letsencrypt.org

Did this fix it?

Cause 2 of 3

An intermediate or root CA carries an extended key usage without clientAuth

You seeerror 26 at 1 depth lookup or higher, while the leaf itself lists clientAuth

Check

Error 26 at depth 1 or higher means a CA certificate above the client has an extended key usage that excludes clientAuth. OpenSSL does not require that extension on CAs, but when one is there without anyExtendedKeyUsage it must include clientAuth for the sslclient purpose, and the rule covers the trust anchor too.

Check
openssl x509 -in /etc/nginx/client-ca.crt -noout -subject -ext extendedKeyUsage

Fix

Reissue that CA certificate with no extended key usage, or with clientAuth in it, and sign the client certificates again from the new CA.

Fix
# extension section used when signing the CA certificate
extendedKeyUsage = serverAuth, clientAuth

Verify

Rerun the verify command; the failing depth no longer appears.

Verify
openssl verify -purpose sslclient -CAfile /etc/nginx/client-ca.crt client.crt

Confirmed by docs.openssl.org

Did this fix it?

Cause 3 of 3

The key usage on the client certificate does not include a signing bit

You seeerror 26 at 0 depth lookup although clientAuth is listed

Check

Error 26 at depth 0 with clientAuth present points at the key usage extension of the client certificate. For a target certificate checked as a TLS client, OpenSSL wants that extension, when present, to allow digitalSignature or keyAgreement, so a certificate limited to keyEncipherment fails.

Check
openssl x509 -in client.crt -noout -ext keyUsage,nsCertType

Fix

Reissue with a key usage that contains digitalSignature, using the extension file from the first cause, and leave the legacy nsCertType extension out: if it is present, OpenSSL also demands its SSL client bit.

Fix
keyUsage = critical, digitalSignature
extendedKeyUsage = clientAuth

Verify

Repeat the purpose check against the new certificate.

Verify
openssl verify -purpose sslclient -CAfile /etc/nginx/client-ca.crt client.crt

Confirmed by docs.openssl.org

Did this fix it?

How do I stop it coming back?

  • Keep a separate extension file for each role your CA signs (server, client, intermediate), so client certificates always carry clientAuth.
  • Run openssl verify -purpose sslclient on each client certificate before it leaves your hands.
  • Log $ssl_client_verify and $ssl_client_s_dn while rolling out client certificates, so a refusal names the certificate.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine on the same stack: TaxiDex, stegnor.com.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.