Chrome NET::ERR_CERT_AUTHORITY_INVALID error on self signing certificate at LocalHost
We can simply allow invalid certificates for developing purposes in chrome.
This is only valid for Localhost
Paste this in your chrome address bar:
chrome://flags/#allow-insecure-localhost
Then enable the highlighted text: Allow invalid certificates for resources loaded from localhost
Here are my instructions using the KeyStore Explorer tool.
The 2 things I was previously missing when I created the cert were:
- AKID (Authority Key Identifier) - select the same "CN=" you used when creating it.
- Adding in the "Basic Constraints" option (do not select "is a CA")
Without those 2 things Chrome will issue warnings / errors even when you have installed the self-signed certificate into your MS-CAPI PKI Trust store (as a "Trusted Root Authority).
Here are the steps I used.
- Instructions using KSE (KeyStore Explorer)
- Create a JKS
- Creating a self-signed certificate
- Open KeyStore Explorer
- File | New | JKS | OK
- Create a Password for your JKS file
- File | Save as... | enter your password
- Enter file name | OK
- Tools | Generate Key Pair
- Select Algorithm and Key Size (i.e. 2048) | OK
- Select validity period (i.e. 5 years)
- Select Name (Book icon) | Enter in Name fields | OK
- I.e. “CN=localhost…”
- Add Extensions (Very Important), this determines what type of certificate it will be and how it can be used. This example will be for a standard server certificate with SSL.
- Add in the Key Usage item
- Add in the Digital Signature and Key Encipherment options checkbox
- Add in the EKU (Extended Key Usage) options
- Select both of these options:
- TLS Web Client Authentication
- TLS Web Server Authentication
- Add in the SANs (Subject Alternative Name)
- Add in all the needed DNS names and IP Addresses (if applicable) for which this server will be used. (repeat for all desired values) (e.g. 127.0.0.1 and localhost (or )
- It will look something like this when it's done
- When it's done you will see all the fields with the OIDs (Object Identifiers) listed | OK | OK
- Add in the AKID (Authority Key Identifier)
- Add Extensions "+"
- Add Extension Type | Authority Key Identifier
- Select the Authority Cert Issuer of the CN that you created above (.e.g "CN=localhost...") | OK
- Add in a "Basic Constraints" (do NOT check "Subject is a CA")
- When you're done you'll see these listed: hit "OK"
- Note: the Basic Constraints and AKID (Authority Key Identifer) are needed for the Chrome Browser to validate the self-signed certificate as a trusted certificate.
- Otherwise you'll see warning or error messages even after you have add this certificate, explicitly, to your MS-CAPI Trusted Root certificates.
- Enter in the Alias of the keypair name you want to use
- Enter in the private keypair password
- *Note: this password MUST be the same as the JKS file keystore password or Java may fail silently when trying to use this certificate.
- You should see a message indicating success. | OK
- Then, save the File | Save
I fixed my exactly same issue following this .
Issue seemed to be in the way the certificate was created.
The code below is from the above site.
#!/usr/bin/env bashmkdir ~/ssl/openssl genrsa -des3 -out ~/ssl/rootCA.key 2048openssl req -x509 -new -nodes -key ~/ssl/rootCA.key -sha256 -days 1024 -out ~/ssl/rootCA.pem#!/usr/bin/env bashsudo openssl req -new -sha256 -nodes -out server.csr -newkey rsa:2048 -keyout server.key -config <( cat server.csr.cnf )sudo openssl x509 -req -in server.csr -CA ~/ssl/rootCA.pem -CAkey ~/ssl/rootCA.key -CAcreateserial -out server.crt -days 500 -sha256 -extfile v3.ext
server.csr.cnf file
[req]default_bits = 2048prompt = nodefault_md = sha256distinguished_name = dn[dn]C=USST=New YorkL=RochesterO=End PointOU=Testing DomainemailAddress=your-administrative-address@your-awesome-existing-domain.comCN = localhost
v3.ext file
authorityKeyIdentifier=keyid,issuerbasicConstraints=CA:FALSEkeyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEnciphermentsubjectAltName = @alt_names[alt_names]DNS.1 = localhost