title: How do I create/install self-signed SSL cert on local Windows virtualhost dev machine that Chrome will trust?
body: <p>As the titles says. I'm starting to add Service Workers to a site, and in order to work they require a valid SSL cert. I've had my local dev server delivering over https with a self-signed cert for a while, albeit with Chrome giving the "Not secure" message that I've just been ignoring until now. I've seen a lot of similar questions on here (using localhost), but nothing matching my exact setup (using virtual hosts on localhost), and nothing I've tried has worked.</p>
  
  <p>I'll describe my setup:</p>
  
  <ul>
  <li>This is for a local dev machine. I don't need anything super secure. I just need Chrome to trust it.</li>
  <li>My dev stack is Apache on Windows 10 (running PHP and ColdFusion).</li>
  <li>I have multiple sites set up locally (127.0.0.1) with Apache virtual hosts, e.g.:
  
  <ul>
  <li><a href="https://michael.domain1.com" rel="noreferrer">https://michael.domain1.com</a> (local dev copy of www.domain1.com)</li>
  <li><a href="https://michael.domain2.com" rel="noreferrer">https://michael.domain2.com</a> (local dev copy of www.domain2.com)</li>
  <li>etc...</li>
  </ul></li>
  <li>To get https working on each of those I used the Win64 OpenSSL v.1.1.0e installer from Shining Light Productions and set up a certificate for each domain in my Apache httpd-vhosts.conf.</li>
  <li>I used the following create my cert:
  <code>openssl req –x509 –nodes -sha256 –days 3650 –newkey rsa:2048 –keyout michael.domain1.key –out michael.domain1.crt -subj "/C=US/ST=Michigan/L=SomeCity/O=CompanyName/OU=Dev/CN=michael.domain1.com"</code></li>
  <li>I opened up the .crt file my virtual host is using and installed it to the Windows Trusted Root Certification Authorities.</li>
  <li>(All of this up until this point has been working fine. I can access the site over <a href="https://michael.domain1.com" rel="noreferrer">https://michael.domain1.com</a>, but I see Chrome's "Not secure" message.)</li>
  </ul>
  
  <p>In Chrome Dev Tools Security tab, I have two errors:</p>
  
  <ul>
  <li>Subject Alternative Name Missing: The certificate for this site does not contain a Subject Alternative Name extension containing a domain name or IP address.
  
  <ul>
  <li>How do I add this? But also for my setup, what do I use for the value? Is it supposed to be michael.domain1.com?</li>
  </ul></li>
  <li>Certificate Error: There are issues with the site's certificate chain (net::ERR_CERT_COMMON_NAME_INVALID).
  
  <ul>
  <li>Is michael.domain1.com not the correct value for this? Am I adding it in the right place with my openssl command above?</li>
  </ul></li>
  </ul>
  
  <p>Thank you.</p>