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

NetLeverage
NetLeverage

Backups to an S3 or HTTPS target fail after certificate renewal: 'unable to get local issuer certificate'

Technical article
Backup & Recovery

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.

The backup client received the server's certificate but could not link it to any certificate authority (CA) it trusts. After a renewal, common causes include: the server now sends only its own certificate and not the intermediate CA certificate, the CA's chain has changed and the client's trust store is older than the chain, or the target uses a private CA the backup host was never told about.

Turning verification off makes the error disappear and removes the only check that the system receiving your backups is the one you meant. The fix is to make the chain complete and the trust correct.

What the error means

TLS verification builds a path from the server's certificate (the leaf), through any intermediate CA certificates, to a trust anchor in the client's trust store. OpenSSL documents the failure as X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: unable to get local issuer certificate, "The issuer certificate could not be found: this occurs if the issuer certificate of an untrusted certificate cannot be found." (X509_STORE_CTX_get_error). Its neighbours matter for diagnosis:

  • unable to get issuer certificate: "The issuer certificate of a locally looked up certificate could not be found. This normally means the list of trusted certificates is not complete." The same page notes that "Previous versions of this documentation swapped the meaning" of these two codes, so older articles may describe them the wrong way round.
  • self-signed certificate in certificate chain: the chain was built from the untrusted certificates but "no suitable trust anchor (which typically is a self-signed root certificate) could be found in the trust store."
  • certificate has expired, and certificate is not yet valid: the validity dates fail against the current time.

Which text you see depends on the client. Tools written in Go print a different wording. In Go's source, an unknown issuer returns x509: certificate signed by unknown authority, optionally followed by (possibly because of ... while trying to verify candidate authority certificate ...), and a date problem returns x509: certificate has expired or is not yet valid: ... (verify.go). Other clients word the error differently.

Why a renewal can break it

The server must send its leaf first and should send the intermediates. RFC 8446 section 4.4.2 says: "The sender's certificate MUST come in the first CertificateEntry in the list. Each following certificate SHOULD directly certify the one immediately preceding it." A trust anchor "MAY be omitted from the chain, provided that supported peers are known to possess any omitted certificates." Intermediates are not covered by that allowance: if the server leaves one out, a client without a copy cannot finish the path.

Certbot's documentation shows how this happens on a renewal. It says cert.pem "contains the server certificate by itself", chain.pem holds the intermediates, and fullchain.pem has "all certificates, including server certificate" with "the server certificate ... first in this file, followed by any intermediates." It warns that if you provide one of these files you must provide both, or "some browsers will show 'This Connection is Untrusted' errors for your site, some of the time." (Certbot: using). A web server pointed at cert.pem after a renewal serves an incomplete chain.

A CA can also change its chain. The Let's Encrypt Chains of Trust page (updated 11 November 2026) lists its active intermediates as YE1, YE2, YR1 and YR2, each valid to 2028-09-02, and says that chains ending at ISRG Root X2 "will only work with clients that have received an update to their trust store after 2022 or so", while chains ending at Root YE or Root YR "are not expected to work with any of the major trust stores, as those roots have not yet been incorporated." Its integration guide says not to hardcode the intermediate, "since intermediates are likely to change". A backup host with an old trust store, or a script that copied the previous intermediate, can break at renewal.

Likely causes

Cause What you see How to confirm
Server sends the leaf only -showcerts lists one certificate Count the certificates the server sends
Wrong chain file deployed after renewal Worked before the renewal, fails after The deployed file is the leaf-only file, not the full chain
CA changed intermediate or root; old trust store Fails on older hosts only The chain's root is absent from the backup host's trust store
Private or internal CA Always failed from this host, or from new hosts Issuer is your own CA, not in the host's store
Backup tool uses its own trust file Another tool on the same host succeeds while the backup tool fails The tool's environment sets a CA file
Certificate expired, or host clock wrong Message says expired or not yet valid Compare dates with the host's UTC time
Wrong certificate presented (SNI or load balancer) Subject does not match the endpoint name -servername changes what is served

Prove the cause before changing anything

These commands are taken from the OpenSSL documentation and have not been run. Run them from the backup host, not your own PC, because the fault depends on that host's trust store.

Show what the server actually sends. The s_client page says -showcerts "displays the server certificate list as sent by the server: it only consists of certificates the server has sent (in the order the server has sent them). It is not a verified chain." -servername sets the SNI name in the ClientHello.

openssl s_client -connect s3.example.net:443 -servername s3.example.net -showcerts

The connection stays open, as the page says "an HTTP command can be given such as 'GET /' to retrieve a web page", so end the session once you have the output. Count the certificates in the list. One means the server sends only its leaf.

Make s_client behave as strictly as a backup client, with the trust file that client uses:

openssl s_client -connect s3.example.net:443 -servername s3.example.net -verify_return_error -CAfile <ca-bundle-file>

-verify_return_error "returns verification errors instead of continuing". Without it, the page warns, s_client "will accept any certificate chain (trusted or not) sent by the peer", so its normal output is not a check by itself.

Save each certificate block from the output into its own file by hand, then inspect them with the x509 command:

openssl x509 -in leaf.pem -noout -subject -issuer -dates

-subject prints the subject, -issuer the issuer and -dates the start and expiry dates. If the leaf's issuer is not the subject of any certificate the server sent, the intermediate is missing.

Test chain building offline with openssl verify: -untrusted is "a file or URI of untrusted certificates to use for chain building", and -CAfile supplies trusted roots.

openssl verify -show_chain -CAfile <ca-bundle-file> -untrusted intermediates.pem leaf.pem

If this succeeds only when you supply the intermediate yourself, the server is not sending it.

Example (illustrative): backups to a self-hosted S3-compatible endpoint s3.nas.example.net start failing the morning after a manual renewal. s_client -showcerts lists one certificate. openssl x509 -noout -issuer -dates shows an issuer named Example Issuing CA 2 (invented), valid dates current. No certificate with that subject came from the server. openssl verify with only the system bundle reports unable to get local issuer certificate; adding the intermediate through -untrusted makes it pass. The renewal installed the leaf file and left out the intermediates.

Fix

Match the fix to the cause. Back up the current certificate files and the server configuration before changing anything.

Missing intermediate. Install a file with the leaf first, then each intermediate, in order, as RFC 8446 requires; the root can be left out. With Certbot, point the server at fullchain.pem: Certbot says this "is what Apache >= 2.4.8 needs for SSLCertificateFile, and what Nginx needs for ssl_certificate." For a commercial CA, build the file from the leaf and the intermediate bundle the CA supplied. Reload the service, then repeat the s_client check. S3-compatible products and appliances have their own certificate screens; follow that product's documentation for where the chain goes.

Old trust store, or a changed chain. Update the backup host's CA bundle through its normal operating system or package updates (follow the operating system's own documentation), then re-test. If the CA offers alternative chains, the Let's Encrypt page says chains ending at ISRG Root X1 have "the greatest compatibility with older clients", and tells you to follow your ACME client's documentation to request an alternative chain (for example Certbot's --preferred-chain). Do not hardcode a single intermediate.

Private CA. Give the backup tool the CA certificate it must trust, in the way that tool supports. For curl-based tools, --cacert [file] or the environment variable CURL_CA_BUNDLE (curl: SSL certificates). For Go programs, SSL_CERT_FILE and SSL_CERT_DIR "can be used to override the system default locations" (crypto/x509). Caution: the page says the variables override the system default locations, so read this as meaning the file you supply must contain every root the tool needs, not only your private one (our reading of that sentence). The same page notes that on Windows and macOS, setting them stops the system verification APIs being used (a change documented for Go 1.27).

Expired or not yet valid. Renew, or correct the host clock. A wrong clock produces the same family of errors; time faults are covered in the neighbouring article on time synchronisation.

Do not disable certificate verification on the backup job, whether by a flag, an environment variable or a global setting. The check exists to confirm the machine you are sending backups to is the one you intended; curl describes verification as "verifying the signature and making sure the certificate was crafted for the server name". If someone has already done this to get through the night, treat it as a fault to remove, not a fix.

Confirm the fix

  1. openssl s_client ... -verify_return_error -CAfile <ca-bundle-file> completes without a verification error from the backup host.
  2. The server sends the leaf plus intermediates in order.
  3. The next backup runs with verification on.
  4. A successful upload is not proof that the data can be recovered. Restore a recent object or snapshot to a scratch location, and compare it with the source.

What to watch afterwards

  • Monitor the expiry dates of every certificate on every backup target, from the backup hosts' point of view.
  • Make the renewal hook deploy the full chain file, and test the chain after each renewal, not only the leaf. Shorter certificate lifetimes mean this happens more often; the related article on renewal schedules covers automation.
  • Keep a record of which trust file each backup tool reads.
  • Recurrence signal: the fault returning on every renewal means the deployment step, not the certificate, is wrong.

Risks and limits

  • These commands have not been run or lab-tested. They are taken from the OpenSSL, curl, Certbot and Go documentation.
  • Error wording differs between clients. This article quotes the OpenSSL and Go x509: messages; curl, Python, AWS CLI and other tools word the error differently.
  • The s_client documentation does not describe a "verify return" line, so none is shown here.
  • The Let's Encrypt intermediates and dates are as shown on the page updated 11 November 2026 and change over time.
  • To update a host trust store, follow the operating system's own documentation.
  • A server behind a load balancer may present different chains per node; test each address you can reach.

Sources