# HAProxy: unable to load SSL private key from PEM file / no certificate found (crt bundle format)

**Code:** `HAProxy` · **Category:** SSL / TLS · **Seen on:** HAProxy, SSL, Linux

HAProxy needs the certificate chain and private key concatenated in one PEM, and it can't read yours.

## Meaning

Build the bundle in the right order: `cat fullchain.pem privkey.pem > site.pem` (leaf, intermediates, key) or provide `crt` and `key` separately. Check file permissions, that the key matches the certificate and that there is a trailing newline between parts.

## Common causes

- Key missing from the bundle
- Wrong order or missing newline between PEM blocks
- Key/certificate mismatch
- HAProxy user can't read the file
- Encrypted key without passphrase support

## Quick fix

1. `cat fullchain.pem privkey.pem > /etc/haproxy/certs/site.pem`
2. `chmod 600` and set owner
3. `haproxy -c -f /etc/haproxy/haproxy.cfg`

## Detailed fix by platform

### Shell

1. 

```bash
cat /etc/letsencrypt/live/example.com/fullchain.pem /etc/letsencrypt/live/example.com/privkey.pem > /etc/haproxy/certs/example.com.pem
haproxy -c -f /etc/haproxy/haproxy.cfg
```


## How to diagnose

1. **Bundle** — Chain + key?
2. **Order** — Right?
3. **Permissions** — Readable?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/ssl/haproxy-unable-to-load-ssl-private-key-pem)
