Self-signed/CSR certificate rejected: no Subject Alternative Name (openssl req needs -addext)
A certificate made with a plain openssl req has only a CN, and modern clients ignore the CN.
openssl req subjectAltName -addextcertificate has no Subject Alternative Namex509: certificate relies on legacy Common Name fieldmissing subject alternative name self-signednet::ERR_CERT_COMMON_NAME_INVALID self signed no SAN Meaning
Add the SAN when creating it: openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365 -subj "/CN=example.com" -addext "subjectAltName=DNS:example.com,DNS:www.example.com,IP:127.0.0.1". For CSRs, put SANs in an openssl.cnf section or -addext.
Common causes
- CN-only certificate
- No
-addext subjectAltName - SANs missing in the config file
- Using an old tutorial
- IP access without an IP SAN
⚡ Quick fix
- Use
-addext subjectAltName=... - Define
[alt_names]in a config and-extensions v3_req - Re-issue the certificate
Detailed fix by platform
Shell
openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365 -subj "/CN=localhost" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1"
How to diagnose
- SAN — Present?
- CN — Only name?
- Command — Includes addext?
🔧 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
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