Recently, Chrome has stopped working with my self signed SSL certs, and thinks they're insecure. When I look at the cert in the DevTools | Security
tab, I can see that it says
Subject Alternative Name Missing The certificate for this site does not contain a Subject Alternative Name extension containing a domain name or IP address.
Certificate Error There are issues with the site's certificate chain (net::ERR_CERT_COMMON_NAME_INVALID).
How can I fix this?
Following solution worked for me on chrome 65 (ref) -
Create an OpenSSL config file (example: req.cnf)
Create the certificate referencing this config file
on MAC starting from chrome Version 67.0.3396.99 my self-signed certificate stopped to work.
regeneration with all what written here didn't work.
UPDATE
had a chance to confirm that my approach works today :). If it doesn't work for you make sure your are using this approach
copied from here https://ksearch.wordpress.com/2017/08/22/generate-and-import-a-self-signed-ssl-certificate-on-mac-osx-sierra/
END UPDATE
finally was able to see green Secure only when removed my cert from system, and added it to local keychain. (if there is one - drop it first). Not sure if it maters but in my case I downloaded certificate via chrome, and verified that create date is today - so it is the one I've just created.
hope it will be helpful for someone spend like a day on it.
never update chrome!
I created a bash script to make it easier to generate self-signed TLS certificates that are valid in Chrome.
After you install the certificates, make sure to restart chrome (
chrome://restart
). Tested onChrome 65.x
and it is still working.Another (much more robust) tool worth checking out is CloudFlare's
cfssl
toolkit:I was able to get rid of (net::ERR_CERT_AUTHORITY_INVALID) by changing the DNS.1 value of v3.ext file
[alt_names] DNS.1 = domainname.com
Change domainname.com with your own domain.
I simply use the
-subj
parameter adding the machines ip address. So solved with one command only.You can add others attributes like C, ST, L, O, OU, emailAddress to generate certs without being prompted.
To fix this, you need to supply an extra parameter to
openssl
when you're creating the cert, basically-sha256 -extfile v3.ext
where
v3.ext
is a file like so, with%%DOMAIN%%
replaced with the same name you use as yourCommon Name
. More info here and over here. Note that typically you'd set theCommon Name
and%%DOMAIN%%
to the domain you're trying to generate a cert for. So if it waswww.mysupersite.com
, then you'd use that for both.v3.ext
Note: Scripts that address this issue, and create fully trusted ssl certs for use in Chrome, Safari and from Java clients can be found here
Another note: If all you're trying to do is stop chrome from throwing errors when viewing a self signed certificate, you can can tell Chrome to ignore all SSL errors for ALL sites by starting it with a special command line option, as detailed here on SuperUser