ssldnsopensslwindows-7-x64

Creating self signed certificate for domain and subdomains - NET::ERR_CERT_COMMON_NAME_INVALID


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?


Solution

  • As Rahul stated, it is a common Chrome and an OSX bug. I was having similar issues in the past. In fact I finally got tired of making the 2 [yes I know it is not many] additional clicks when testing a local site for work.

    As for a possible workaround to this issue [using Windows], I would using one of the many self signing certificate utilities available.

    Recommended Steps:

    1. Create a Self Signed Cert
    2. Import Certificate into Windows Certificate Manager
    3. Import Certificate in Chrome Certificate Manager
      NOTE: Step 3 will resolve the issue experienced once Google addresses the bug...considering the time in has been stale there is no ETA in the foreseeable future.**

      As much as I prefer to use Chrome for development, I have found myself in Firefox Developer Edition lately. which does not have this issue.

      Hope this helps :)