I followed this tutorial for creating Signed SSL certificates on Windows for development purposes, and it worked great for one of my domains(I'm using hosts file to simulate dns). Then I figured that I have a lot of subdomains, and that would be a pain in the ass to create a certificate for each of them. So I tried creating a certificate using wildcard in Common
field as suggested in some of the answers at serverfault. Like this:
Common Name: *.myserver.net/CN=myserver.net
However, after importing this certificate into Trusted Root Certification Authority, I'm getting NET::ERR_CERT_COMMON_NAME_INVALID
error in Chrome, for main domain and all of its subodmains, for example: https://sub1.myserver.net
and https://myserver.net
.
This server could not prove that it is myserver.net; its security certificate is from *.myserver.net/CN=myserver.net.
This may be caused by a misconfiguration or an attacker intercepting your connection.
Is there something wrong in Common Name field that is causing this error?
I think it may be a bug in chrome. There was a similar issue long back: See this.
Try in a different browser. I think it should work fine.
A workaround is to add the domain names you use as "subjectAltName" (X509v3 Subject Alternative Name). This can be done by changing your OpenSSL configuration (
/etc/ssl/openssl.cnf
on Linux) and modify thev3_req
section to look like this:With this in place, not forget to use the
-extensions v3_req
switch when generating your new certificate. (see also How can I generate a self-signed certificate with SubjectAltName using OpenSSL?)Chrome 58 has dropped support for certificates without Subject Alternative Names.
Moving forward, this might be another reason for you encountering this error.
Your wildcard
*.example.com
does not cover the root domainexample.com
but will cover any variant on a sub-domain such aswww.example.com
ortest.example.com
The preferred method is to establish Subject Alternative Names like in Fabian's Answer but keep in mind that Chrome currently requires the Common Name to be listed additionally as one of the Subject Alternative Names (as it is correctly demonstrated in his answer). I recently discovered this problem because I had the Common Name
example.com
with SANswww.example.com
andtest.example.com
, but got theNET::ERR_CERT_COMMON_NAME_INVALID
warning from Chrome. I had to generate a new Certificate Signing Request withexample.com
as both the Common Name and one of the SANs. Then Chrome fully trusted the certificate. And don't forget to import the root certificate into Chrome as a trusted authority for identifying websites.If you're tired of this error. You can make Chrome not act out like this. I'm not saying it's the best way just saying it's a way.
Found this information on Symantec support page: https://support.symantec.com/en_US/article.TECH240507.html
For everyone who is encountering this and wants to accept the risk to test it, there is a solution: go to Incognito mode in Chrome and you'll be able to open "Advanced" and click "Proceed to some.url".
This can be helpful if you need to check some website which you are maintaining yourself and just testing as a developer (and when you don't yet have proper development certificate configured).
Of course this is NOT FOR PEOPLE using a website in production where this error indicates that there is a problem with website security.