PEM routines: bad end line / no start line — Windows CRLF line endings or truncated PEM file
OpenSSL can't parse a PEM file because it has Windows line endings, missing newlines or a damaged BEGIN/END line.
PEM routines:PEM_read_bio:bad end linebad end line PEMerror:0909006C:PEM routines:get_name:no start linePEM_read_bio_X509_AUX bad end lineCRLF PEM file Meaning
Convert line endings (dos2unix cert.pem), make sure each -----BEGIN and -----END line is on its own line, and that the file wasn't copied through a rich-text editor. Wrapped/unwrapped base64 at 64 chars also matters for strict parsers.
Common causes
- CRLF line endings
- Certificate pasted from a rich-text editor
- Missing newline after the END line
- Extra characters/quotes around the PEM
- Truncated copy
⚡ Quick fix
dos2unix cert.pem- Re-copy the PEM as plain text
- Check with
openssl x509 -in cert.pem -noout -text
Detailed fix by platform
Shell
- bash
dos2unix cert.pem file cert.pem head -1 cert.pem; tail -1 cert.pem
How to diagnose
- Line endings — LF?
- BEGIN/END — Intact?
- Editor — Plain text?
🔧 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
- ACM region CloudFront can't use my ACM certificate: it must be requested in us-east-1 (N. Virginia)
- bare LF SMTP rejects bare line feeds: 550 5.6.11 SMTPSEND.BareLinefeedsAreIllegal / Bare LF not allowed (SMTP smuggling defence)
- 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