OpenSSL/Nginx/Apache: error:0909006C:PEM routines:get_name:no start line / unable to load Private Key
The server or tool cannot read the private key file — wrong format, encrypted with a passphrase, wrong path, or a certificate pasted where the key belongs.
unable to load Private Keyerror:0909006C:PEM routines:get_name:no start linePEM_read_bio:no start lineExpecting: ANY PRIVATE KEYproblems getting password Meaning
Check the file really begins with -----BEGIN PRIVATE KEY----- / BEGIN RSA PRIVATE KEY. Encrypted keys need a passphrase or must be decrypted (openssl rsa -in enc.key -out plain.key). DER or PKCS#12 files must be converted to PEM. Also confirm permissions allow the server to read it.
Common causes
- Certificate file given in place of the key
- Key encrypted with a passphrase (server can't prompt)
- DER/PFX format instead of PEM
- Wrong path or permissions
- Windows line endings or truncated copy-paste
⚡ Quick fix
- Inspect:
head -1 server.key - Decrypt:
openssl rsa -in enc.key -out server.key - Convert PFX:
openssl pkcs12 -in x.pfx -nocerts -nodes -out server.key
Detailed fix by platform
Linux
openssl rsa -in server.key -check -nooutvalidates an RSA key
How to diagnose
- Header — BEGIN PRIVATE KEY?
- Encrypted — Passphrase?
- Format — PEM?
🔧 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
- ca md too weak / ee key too small OpenSSL: error:0A00018E:SSL routines::ca md too weak / error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small
- certificate does not have a private key (IIS) Windows/IIS: A specified logon session does not exist / The certificate does not have a private key associated with it
- Keystore was tampered with, or password was incorrect Java keytool: java.io.IOException: Keystore was tampered with, or password was incorrect
Most viewed in SSL / TLS
- NET::ERR_CERT_COMMON_NAME_INVALID NET::ERR_CERT_COMMON_NAME_INVALID: Your connection is not private (certificate is for a different domain)
- Challenge failed for domain Let’s Encrypt / Certbot: Challenge failed for domain example.com — Invalid response from http://example.com/.well-known/acme-challenge/x: 404
- Certificate pinning failure! Android/OkHttp: javax.net.ssl.SSLPeerUnverifiedException: Certificate pinning failure! Peer certificate chain: sha256/... Pinned certificates for api.example.com
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 4 Nov 2026