Why Valid SSL Certificates Break in API Clients and IoT Devices

It is a familiar and incredibly frustrating scenario for DevOps engineers and backend developers: you deploy a new SSL/TLS certificate to your web server, load the site in Google Chrome, and see the c...

Tim Henrich
October 28, 2026
7 min read
117 views

Why Valid SSL Certificates Break in API Clients and IoT Devices

It is a familiar and incredibly frustrating scenario for DevOps engineers and backend developers: you deploy a new SSL/TLS certificate to your web server, load the site in Google Chrome, and see the comforting padlock icon. Everything appears perfectly secure.

However, minutes later, your monitoring alerts trigger. Your mobile application cannot connect to the API. External webhooks from payment providers like Stripe are failing to deliver. Your automated CI/CD pipelines running curl commands are throwing fatal CERTIFICATE_VERIFY_FAILED errors.

If the certificate is valid and the browser trusts it, why are your programmatic clients failing?

The answer almost always lies in certificate chain validation. While leaf certificate expiration is a well-understood concept, chain validation failures are the hidden culprits behind countless modern API, IoT, and application outages. As the industry accelerates toward shorter certificate lifespans and automated renewals, understanding how to configure, debug, and monitor complete certificate chains is no longer optional.

The "Browser Lie" and Authority Information Access (AIA)

To understand why a certificate works in a browser but fails in a script, you have to understand how different clients handle incomplete certificate chains.

When a client connects to a secure server, the server is supposed to present a "chain of trust." This chain starts with the server's specific certificate (the leaf), followed by one or more Intermediate Certificate Authorities (CAs), and traces back to a Root CA that the client already trusts in its local operating system or browser trust store.

The most common misconfiguration in TLS deployment is the "Missing Intermediate." The server sends the leaf certificate but forgets to send the intermediate certificate connecting it to the root.

Modern web browsers like Google Chrome and Microsoft Edge are designed to be highly forgiving. If they receive a leaf certificate without an intermediate, they look at a specific extension inside the leaf certificate called Authority Information Access (AIA). The AIA extension contains a URL pointing to the missing intermediate certificate. The browser quietly pauses the TLS handshake, downloads the missing intermediate certificate on the fly, reconstructs the chain, and loads the page.

The human tester sees a secure site and assumes the deployment was successful.

Programmatic clients, however, are strict. Command-line tools like curl, HTTP libraries like Python's requests or Node.js axios, Java HTTP clients, and most embedded IoT operating systems do not support AIA fetching. If the server fails to provide the complete chain during the initial TLS handshake, these clients will immediately terminate the connection.

This discrepancy creates a massive blind spot for engineering teams who rely solely on browser testing to verify their TLS deployments.

Common Certificate Chain Misconfigurations

Beyond the missing intermediate, several other subtle misconfigurations can break programmatic clients while leaving browsers unaffected.

1. Out-of-Order Certificate Chains

The TLS specification requires that the certificate chain be sent in a specific, sequential order. The server must send the leaf certificate first, followed by the intermediate that signed the leaf, followed by the intermediate that signed that intermediate, and so on.

If a server sends the chain out of order (for example, Leaf -> Root -> Intermediate), some advanced TLS stacks can dynamically reconstruct the correct path. However, strict parsers—such as older versions of OpenSSL, specific mobile app frameworks, or embedded IoT systems—will fail the handshake entirely.

2. Including the Root Certificate in the Handshake

Many administrators mistakenly include the Root CA certificate at the very bottom of their chain file. While this rarely causes a hard failure, it is a significant misconfiguration.

The fundamental rule of Public Key Infrastructure (PKI) is that the client must already possess the Root CA in its local trust store for validation to succeed. Sending the root certificate over the wire does not make an untrusting client trust it. Instead, it unnecessarily bloats the size of the TLS handshake, wasting bandwidth and increasing latency.

This bloat is becoming a critical issue as the industry transitions to Post-Quantum Cryptography (PQC). PQC algorithms finalized by NIST (like FIPS 203, 204, and 205) generate significantly larger certificate sizes. Including unnecessary root certificates in a PQC or hybrid chain increases the risk of packet fragmentation, which can cause connection timeouts on unreliable networks.

3. Cross-Signing Expiration and Legacy Trust Stores

Certificate Authorities frequently cross-sign new intermediate certificates with older, established Root CAs to ensure compatibility with older devices.

A prime example occurred when Let's Encrypt phased out their cross-signed chain for the old DST Root CA X3, relying solely on their own ISRG Root X1. Millions of legacy IoT devices, older Android phones, and smart TVs that had not received firmware updates lacked the new ISRG Root X1 in their trust stores.

When servers automatically renewed their certificates and began serving the new chain, these legacy devices suffered a total blackout. They could not validate the new chain, and because they lacked automated mechanisms to update their local root stores, they required manual firmware flashing to restore connectivity.

Real-World Impact: The API Webhook Problem

Chain validation issues frequently surface in microservices architectures and API integrations.

Consider a merchant integrating with a payment provider like Stripe. The merchant updates the SSL certificate on their backend server to receive payment webhooks. They deploy the leaf certificate, test the endpoint in their browser, and everything looks fine.

However, Stripe's backend infrastructure—like most enterprise B2B platforms—strictly enforces chain validation without AIA fetching. When a customer makes a payment, Stripe attempts to send the webhook, encounters an incomplete chain, and drops the connection. The merchant loses visibility into successful payments, resulting in unfulfilled orders and customer support nightmares, all because an intermediate certificate was missing from a configuration file.

Major Content Delivery Networks (CDNs) have also fallen victim to this. Recently, a global CDN provider experienced localized routing failures when a newly provisioned edge server was deployed with an incomplete chain. API traffic routed to that specific edge node dropped by 100% until the intermediate certificate was appended to the PEM file, highlighting how a single missing block of text can cause widespread localized outages.

Debugging Chain Issues Like a Pro

To prevent these outages, you must test your endpoints using tools that mimic strict programmatic clients, rather than relying on web browsers.

The most reliable way to debug a certificate chain from the command line is using OpenSSL. By using the s_client command, you can see exactly what the server is transmitting during the handshake.

# Test the certificate chain of a remote server
openssl s_client -connect api.yourdomain.com:443 -servername api.yourdomain.com

When you run this command, look closely at the Certificate chain section of the output:

A Broken (Missing Intermediate) Output:

Certificate chain
 0 s:CN = api.yourdomain.com
   i:C = US, O = Let's Encrypt, CN = R3
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIF...
-----END CERTIFICATE-----
---
Verify return code: 21 (unable to verify the first certificate)

Notice that only 0 (the leaf) is sent. The Verify return code: 21 explicitly tells you the chain is broken because the client cannot find the issuer (R3).

A Healthy, Complete Output:

Certificate chain
 0 s:CN = api.yourdomain.com
   i:C = US, O = Let's Encrypt, CN = R3
 1 s:C = US, O = Let's Encrypt, CN = R3
   i:C = US, O = Internet Security Research Group, CN = ISRG Root X1
---
Server certificate
-----BEGIN CERTIFICATE-----
...
Verify return code: 0 (ok)

Here, the server sends both 0 (the leaf) and 1 (the intermediate). The Verify return code: 0 (ok) confirms the chain is valid.

For deeper, automated analysis, you can use CLI tools like TestSSL.sh for internal networks, or the industry-standard Qualys SSL Labs for public-facing endpoints. SSL Labs will explicitly flag "Chain issues: Incomplete" in bright orange, making it easy to spot.

How to Fix Certificate Chain Issues

Fixing an incomplete chain is usually a matter of concatenating the leaf certificate and the intermediate certificates into a single file, often referred to as a "full chain" or "bundle."

If your Certificate Authority provides the leaf certificate (cert.pem) and the intermediate certificate (intermediate.pem) separately, you must combine them. The order is critical: the leaf must be first.

# Combine the leaf and intermediate into a single fullchain file
cat cert.pem intermediate.pem > fullchain.pem

Once you have the fullchain.pem, you must configure your web server or load balancer to

Share This Insight

Related Posts