Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

nginx [warn] "ssl_stapling" ignored, issuer certificate not found for certificate: add ssl_trusted_certificate

Technical article
Hosting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

When ssl_stapling on; is set, nginx needs the certificate that issued your server certificate so it can build an OCSP request. If it cannot find that certificate it logs a warning that reads "ssl_stapling" ignored, issuer certificate not found for certificate "/etc/nginx/ssl/www.example.com.crt" and carries on without stapling. The site still serves. The fix is to make the issuing intermediate available: in the ssl_certificate file after your own certificate, or in a file named by ssl_trusted_certificate.

What the error means

OCSP stapling lets the server attach a signed statement about its certificate's status to the TLS handshake. nginx's documentation for ssl_stapling says: "For the OCSP stapling to work, the certificate of the server certificate issuer should be known. If the ssl_certificate file does not contain intermediate certificates, the certificate of the server certificate issuer should be present in the ssl_trusted_certificate file." It adds that the resolver directive "should also be specified" so the responder's host name can be resolved.

In the nginx 1.26.2 source, the function ngx_ssl_stapling_issuer in src/event/ngx_event_openssl_stapling.c looks for the issuer in two places. First it checks the extra certificates that were loaded after the server certificate from the ssl_certificate file. If none of them issued the server certificate, it asks the certificate store. If neither has it, the code logs the warning at the warn level and returns without an error, so nginx starts and stapling is left off for that certificate. The documentation quoted above is where ssl_trusted_certificate comes in: it names that file as the place for the issuer's certificate. The text between the last pair of quotation marks is the name nginx holds for the certificate, which is the path you gave to ssl_certificate.

The message is written when nginx reads its configuration, so nginx -t, a start and a reload each print it.

Likely causes

Cause What you see How to confirm
The ssl_certificate file holds only your own certificate, and there is no ssl_trusted_certificate The warning on every nginx -t The server block has no ssl_trusted_certificate line (step 2), and the issuer in step 3 is not in the ssl_certificate file
ssl_trusted_certificate is set but names a file that lacks the issuing intermediate, for example a root only The warning stays after you added the line The issuer name of your certificate (step 3) is not the subject name of any certificate in that file (step 4)
Certbot's cert.pem was used where fullchain.pem was intended The warning on every nginx -t The path ends in cert.pem; Certbot's guide says cert.pem contains the server certificate by itself
The directive sits in another server block, or the file was changed but the server block still points at the old path The warning names a different certificate path than the one you edited Read the nginx -T output for the block with that path
A chain file was copied instead of pointed at, so it did not follow a renewal The warning appears after a renewal Certbot says to point the server directly at the files in /etc/letsencrypt/live; check whether the chain file is a copy, then compare its subject with your certificate's issuer

Prove the cause before changing anything

All of these steps only read. nginx -t is a syntax check that also opens the files named in the configuration; it does not change the running server.

1. Reproduce the message.

nginx -t

A bad result includes the [warn] line with the certificate path. The path is the one to look at in the next steps.

2. Read the TLS lines in the configuration nginx is really using.

nginx -T

Find the server block that holds that certificate path and note ssl_certificate, ssl_trusted_certificate, ssl_stapling, ssl_stapling_verify and resolver. nginx's page says -T is "same as -t, but additionally dump configuration files to standard output (1.9.2)". The output can include private paths, so keep it out of public places.

3. Read the issuer of your certificate. The ssl_certificate page says that when intermediates are included in that file, "the primary certificate comes first, then the intermediate certificates." OpenSSL's x509 page lists -issuer, -subject and -noout; openssl x509 reads the first certificate in a file.

openssl x509 -in /etc/nginx/ssl/www.example.com.crt -noout -issuer

4. Read the subject of the intermediate you intend to use.

openssl x509 -in /etc/nginx/ssl/www.example.com.chain.pem -noout -subject

A good result is a subject that is the same as the issuer printed in step 3. If the file holds more than one certificate, this prints only the first, so check that the one you need comes first or is the only one.

Fix

nginx offers two routes. The first is to put the intermediate certificates after your own in the ssl_certificate file, as nginx's HTTPS page and the ssl_certificate page describe for a chained file. The second is to leave that file alone and name the issuer's certificate with ssl_trusted_certificate, which nginx's page describes as "a file with trusted CA certificates in the PEM format used to verify client certificates and OCSP responses if ssl_stapling is enabled." That page adds that, unlike ssl_client_certificate, "the list of these certificates will not be sent to clients."

Certbot's user guide gives the names for a Let's Encrypt certificate: fullchain.pem is what nginx needs for ssl_certificate, and "If you’re using OCSP stapling with Nginx >= 1.3.7, chain.pem should be provided as the ssl_trusted_certificate to validate OCSP responses." If you also turn on ssl_stapling_verify, nginx says the issuer certificate, the root certificate and all intermediate certificates "should be configured as trusted using the ssl_trusted_certificate directive."

First save the current state. The GNU manual says "cp copies files (or, optionally, directories)." and that -p preserves the specified attributes of the original file. Copy the file that holds the server block to /root/, which no include line reads, so nginx does not read the saved copy as configuration:

cp -p /etc/nginx/conf.d/example.com.conf /root/example.com.conf.2026-12-04

Risk: the next edit changes the TLS settings of a live HTTPS site. A wrong path can stop nginx from loading the new configuration. Edit when traffic is low and do not reload until the syntax check passes.

Edit the server block so that it names the file that holds the issuer's certificate. If the block already has an ssl_trusted_certificate line (step 2), change the path on that line to this value; add the line only if the block has none, and never leave two:

ssl_trusted_certificate /etc/nginx/ssl/www.example.com.chain.pem;

Check the syntax and the files. nginx's page describes -t as "test the configuration file: nginx checks the configuration for correct syntax, and then tries to open files referred in the configuration."

nginx -t

A good result no longer prints the ssl_stapling warning for that certificate.

Disruptive step: the next command reloads nginx. nginx's guide says the master process checks the new file and, if it works, starts new worker processes and asks the old ones to shut down; if the check fails it "rolls back the changes and continues to work with the old configuration". Requests in flight are finished by the old workers.

nginx -s reload

Only if you need to back out: copy /root/example.com.conf.2026-12-04 back over example.com.conf.

Risk: the back-out command overwrites the live server file with the saved copy. It discards your edit and any other change made to that file since, so the warning returns.

cp -p /root/example.com.conf.2026-12-04 /etc/nginx/conf.d/example.com.conf

Check the restored file:

nginx -t

Disruptive step: the next command reloads nginx so that it loads the restored file. As above, the old workers finish requests in flight.

nginx -s reload

Example (illustrative): on web01, www.example.com has ssl_certificate /etc/nginx/ssl/www.example.com.crt;, ssl_stapling on; and resolver 192.0.2.53;. nginx -T shows no ssl_trusted_certificate line in that block. The -issuer of the certificate file and the -subject of /etc/nginx/ssl/www.example.com.chain.pem match. The administrator saves the configuration file, adds the ssl_trusted_certificate line with that path, runs nginx -t, which no longer prints the warning, and then nginx -s reload.

Confirm the fix

  1. Run nginx -t again. The ssl_stapling warning is gone for that certificate path.
  2. Ask the server for its status response. OpenSSL's s_client page says -status "Sends a certificate status request to the server (OCSP stapling). The server response (if any) is printed out."
openssl s_client -connect www.example.com:443 -servername www.example.com -status

A good result prints an OCSP response. If no response is printed, the page's words are "The server response (if any) is printed out": the server did not staple one. Go back to step 1 and confirm that nginx -t prints no ssl_stapling warning for the path, then read step 2 again for ssl_stapling on; and resolver.

What to watch afterwards

  • When a certificate is renewed or replaced, read its issuer again with step 3 and compare it with the chain file. A copied chain file does not follow the renewal. Certbot's guide says to point the server "directly to those files (or create symlinks)" in /etc/letsencrypt/live. The renewal side of the same problem is in Certbot renewed but the site still shows the old certificate: reload, deploy hooks and the right file.
  • Keep resolver set. nginx's page says it is needed to resolve the responder's host name.
  • Count ssl_stapling warnings in the configuration test output after each change.

Risks and limits

  • These commands have not been run or lab-tested.
  • The 1.26.2 source treats the missing issuer as a warning and carries on, so the site keeps serving without stapling.
  • The reading of where nginx looks for the issuer comes from the 1.26.2 source and may differ in other versions.
  • nginx -T only reads, but it prints configuration that may include private paths.
  • A different failure, where nginx cannot find any certificate for a listen ... ssl block, is a separate message.

Sources