What the message looks like
Your connection is not private
Attackers might be trying to steal your information from cloud.example.com
NET::ERR_CERT_AUTHORITY_INVALIDCommon causes
- The certificate is self-signed, for example a default one from an appliance, router or fresh install.
- It was issued by an internal CA whose root certificate is not installed on the client.
- The server sends only the leaf certificate without the intermediate, and the client cannot fetch it.
- A proxy, antivirus or firewall re-signs HTTPS traffic with its own root that the browser does not know.
- The wrong virtual host answers, so a default certificate is served instead of yours.
Check
- Who issued the certificate, and for whom?
echo | openssl s_client -connect cloud.example.com:443 -servername cloud.example.com 2>/dev/null | openssl x509 -noout -subject -issuer - What does the chain look like?
echo | openssl s_client -connect cloud.example.com:443 -servername cloud.example.com -showcerts 2>/dev/null | grep -E '^ *[0-9] s:|^ *i:' - What does curl verify say?
curl -vI https://cloud.example.com 2>&1 | grep -iE 'issuer|verify|SSL certificate' - Does the SNI name select the right certificate?
echo | openssl s_client -connect cloud.example.com:443 -servername wrong.example.com 2>/dev/null | openssl x509 -noout -subject
Fix
- If subject and issuer are identical, the certificate is self-signed. For a public host, replace it with one from a public CA such as Let's Encrypt.
- For an internal CA, install the root on the clients. On Debian and Ubuntu: copy the
.crtto/usr/local/share/ca-certificates/and runsudo update-ca-certificates. Browsers and phones need the root imported into their own store. - Serve the full chain: in nginx
ssl_certificateshould point tofullchain.pem, notcert.pem. - If a proxy re-signs traffic, trust its root on that device or exempt the site from inspection.
- Check that the right
server_namehas the right certificate, then reload the web server.
Typical scenario
On an Nginx server, ssl_certificate points to cert.pem instead of fullchain.pem. Desktop browsers often fetch the missing intermediate CA or have it cached, so nobody notices. Then curl, Android apps or Java clients report unable to get local issuer certificate, Chrome shows NET::ERR_CERT_AUTHORITY_INVALID. First count with openssl s_client -showcerts how many certificates the server really sends.
FAQ
Is it safe to click through the warning?
Only for a host you control and recognise, on a network you trust. For anything else the warning exists to stop a man-in-the-middle, so do not accept it.
Why does it work in one browser and fail in another?
Browsers and operating systems keep their own trust stores, and some fetch missing intermediates while others do not. A missing intermediate is a common cause when only some clients fail.
What is the difference between cert.pem and fullchain.pem?
cert.pem holds only your domain's certificate, fullchain.pem adds the intermediate certificates. The server must send the intermediates along, because otherwise clients cannot reliably chain the certificate to a trusted root. In the Nginx configuration, fullchain.pem therefore belongs in ssl_certificate, and the private key in ssl_certificate_key.
Why does curl word the error differently?
curl reports the same problem as unable to get local issuer certificate. It means the chain cannot be followed to an entry in the CA bundle, because an intermediate is missing or the root is unknown to the bundle. With --cacert you can test your own bundle.
How do I get a private CA onto clients?
Import the root certificate into the system trust store, on Debian for example as a .crt file into /usr/local/share/ca-certificates/ followed by update-ca-certificates. Companies distribute it by policy. Firefox may use a store of its own.