# Certificate chain error: an expired intermediate/cross-signed certificate is still served (leaf is valid)

**Code:** `intermediate expired` · **Category:** SSL / TLS · **Seen on:** SSL, OpenSSL

The leaf certificate is fine, but one certificate in the served chain has expired, so some clients reject the connection.

## Meaning

Remove the expired cross-signed/intermediate certificate from your bundle and serve the current chain provided by your CA. Old OpenSSL 1.0.x/GnuTLS clients don't try alternative paths. Check `openssl s_client -showcerts` for each certificate's validity.

## Common causes

- Old cross-signed intermediate included in the bundle
- CA replaced the intermediate but the old file remains
- Clients that can't build an alternative chain
- Chain file not updated at renewal
- Cached chain in the load balancer

## Quick fix

1. Download the current chain from the CA
2. Remove expired certificates from the bundle
3. Reload and re-test with `-showcerts`

## Detailed fix by platform

### Shell

1. 

```bash
openssl s_client -connect example.com:443 -showcerts </dev/null 2>/dev/null | awk '/BEGIN/{c++} {print > "chain" c ".pem"}'
for f in chain*.pem; do openssl x509 -in $f -noout -subject -enddate; done
```


## How to diagnose

1. **Each cert** — Valid?
2. **Bundle** — Current?
3. **Client** — Old library?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/ssl/intermediate-certificate-expired-chain-still-served)
