HAProxy: unable to load SSL private key from PEM file / no certificate found (crt bundle format)
HAProxy needs the certificate chain and private key concatenated in one PEM, and it can't read yours.
unable to load SSL private key from PEM filehaproxy Unable to load SSL certificate from PEM file'bind :443' : unable to load SSL private key from PEM fileno private key found in PEM file HAProxyProxy: unable to load SSL certificate from PEM file 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
cat fullchain.pem privkey.pem > /etc/haproxy/certs/site.pemchmod 600and set ownerhaproxy -c -f /etc/haproxy/haproxy.cfg
Detailed fix by platform
Shell
- 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
- Bundle — Chain + key?
- Order — Right?
- Permissions — Readable?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- bad decrypt openssl: bad decrypt / Could not read private key — wrong passphrase or cipher
- bad end line PEM routines: bad end line / no start line — Windows CRLF line endings or truncated PEM file
- chain order Certificate chain in the wrong order: PEM bundle must start with the leaf, then intermediates
Most viewed in SSL / TLS
- HTTPSConnectionPool: Max retries exceeded (SSLError) Python requests: HTTPSConnectionPool(host='api.example.com', port=443): Max retries exceeded with url: /v1 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] ...')))
- DST Root CA X3 expired (old clients fail) Old clients: certificate has expired — Let's Encrypt chain uses expired DST Root CA X3 (OpenSSL 1.0.x, Android < 7.1.1)
- Keystore was tampered with, or password was incorrect Java keytool: java.io.IOException: Keystore was tampered with, or password was incorrect
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 18 Nov 2026