OpenSSL: Can't open openssl.cnf for reading / error loading config file
OpenSSL can't find or parse its configuration file, so req, ca or x509 commands abort.
Can't open openssl.cnf for readingWARNING: can't open config file: /usr/local/ssl/openssl.cnfError loading config fileUnable to load config info from /usr/local/ssl/openssl.cnfopenssl.cnf not found Meaning
Set OPENSSL_CONF to the right file (export OPENSSL_CONF=/etc/ssl/openssl.cnf, on Windows a path to openssl.cfg), or pass -config file.cnf. Check for BOM/CRLF in custom configs and for missing sections referenced by -extensions.
Common causes
- OPENSSL_CONF unset/wrong (Windows installs)
- Config path with spaces/backslashes
- Custom config has a syntax error
- Section name referenced but missing
- File permissions
⚡ Quick fix
export OPENSSL_CONF=/etc/ssl/openssl.cnf- Use
-configexplicitly - Validate the section names
Detailed fix by platform
Shell
- bash
openssl version -d export OPENSSL_CONF=/etc/ssl/openssl.cnf openssl req -new -config my.cnf -key key.pem -out req.csr
How to diagnose
- Path — Exists?
- Env var — Set?
- Sections — Defined?
🔧 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
- .NET TLS The request was aborted: Could not create SSL/TLS secure channel (.NET Framework TLS 1.2 not enabled)
- 0x800CCC0D Outlook error 0x800CCC0D: Cannot find the server — the host name of the mail server couldn't be resolved
- 0x800CCC0E Outlook error 0x800CCC0E: Cannot connect to the outgoing (SMTP) server — sending failed
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