Self-Signed Certificates: Trust Errors in Browsers and Apps

Private CA: keep the root key offline and apply name constraints to the issuing intermediate.
A self-signed certificate signs itself and acts as its own root, so no trust store knows it by default. Browsers, curl, Java, Python, and mobile apps all reject it with a trust error — which is the correct, expected behavior. Self-signed certificates are acceptable for local development and testing, but public services should use a publicly trusted CA, and real internal services are better served by a private CA: install only the CA root in clients, then issue short-lived leaf certificates. Adding a certificate to one trust store (for example your browser) does not fix curl, Java, Python, or mobile apps — each maintains its own.
Why the trust error is "correct"
Every client validates the server certificate against its own trust store and fails when it finds no matching trusted root. The goal is to make the right client trust the right certificate, not to disable validation. So a self-signed certificate erroring everywhere is a security mechanism working as designed.
Install the certificate into the right trust store
Export the certificate PEM and install it into every store that actually connects: browsers rely on the OS keychain (macOS/Linux/Windows); curl uses a CA bundle (-cacert or SSL_CERT_FILE); Java uses keytool-managed cacerts; Python uses SSL_CERT_FILE or the requests verify parameter; mobile apps use their own stores. Restart the client after installing.
The better option: a private CA
For real internal services, create a private CA, install only its root in client stores, and issue short-lived leaf certificates from it. Every internal service is then trusted without per-host installs, and you avoid the man-in-the-middle risk of disabling validation with curl -k or verify=False.
Step 1: Confirm it is a trust problem, not something else
Use the SSL Checker or openssl to confirm the error is "self-signed / untrusted" rather than expiry or hostname mismatch. Self-signed shows as openssl return code 18 or 19.
Step 2: Export and distribute the certificate
Export the certificate PEM from the server, verify its contents with the Certificate Decoder, then distribute it to each client that needs to connect.
Step 3: Install trust per client
Install the certificate into the relevant store for each client (OS keychain, curl, Java cacerts, Python, app) as described above, then restart the client.
Step 4: Move internal services to a private CA (recommended)
Stand up a private CA for internal services, install its root on clients, and issue short-lived certificates — eliminating per-machine installs and avoiding disabled validation.
Troubleshooting checklist
| Symptom | Likely cause | What to do |
|---|---|---|
| Browser shows NET::ERR_CERT_AUTHORITY_INVALID | Self-signed or missing intermediate | Install in OS keychain or deploy trusted chain |
| curl reports self signed / 60 | curl does not trust the cert | Use -cacert or set SSL_CERT_FILE |
| Java reports PKIX / cacerts issue | Java has its own trust store | Import into cacerts with keytool |
| Python requests raises SSLError | Python ships its own CA bundle | Set SSL_CERT_FILE or verify=path |
| Browser trusts it but the app fails | App uses its own trust logic | Install separately in the app's store |
| Works only with verify=False | Validation disabled (unsafe) | Install the cert or use a private CA |
Tools & further reading
- Certificate Decoder: inspect certificate contents and issuer
- SSL Checker: quickly tell trust / expiry / hostname apart
- CSR Generator: generate CSRs for your private CA
- SSL certificate guide: understand public CAs vs private CAs
- Related: NET::ERR_CERT_AUTHORITY_INVALID: Complete Fix Guide, Fix SSL Protocol Error, Fix SSL Handshake Failed
FAQ
Is it OK to use curl -k or verify=False?
Only for throwaway local testing. Disabling validation exposes you to man-in-the-middle attacks. For anything persistent, install the certificate or use a private CA.
Why does the browser trust it but the app still fails?
Browsers read the OS keychain; many apps (Java, Python, mobile) maintain their own trust logic. Install the certificate into every store the client actually reads.
Can self-signed certificates be used in production?
Not recommended for public-facing services. Internet users will not install your self-signed root and will always error. Internal services are better served by a private CA, balancing security and manageability.
How is a private CA better than self-signed?
You install the CA root once on clients; every leaf it signs is then trusted, which makes rotation and short lifetimes easy, and avoids the security downgrade of disabling validation everywhere.
Free SSL/TLS tools
Verify and inspect your certificates in seconds.
Related Certificate Info
Learn more about choosing and buying certificates.