title: How to trust self-signed localhost certificates on Linux Chrome and Firefox
body: <p>I try to generate a self-signed certificate for a custom local domain pointing to 127.0.0.1:</p>
  
  <pre><code># /etc/hosts
  127.0.0.1 subdomain.domain.local
  </code></pre>
  
  <p>I've generated a self-signed certificate using <code>openssl</code> and remember that everything worked in the past. But it seems that since Chrome 58, there are far more restrictions on using self-signed certificates.</p>
  
  <p>My attempts conclude with "<strong>Your connection is not private</strong>" following with one of the below errors:</p>
  
  <ul>
  <li>"<strong>security certificate is not trusted</strong>" if I proceed like in the past.</li>
  <li>"<strong>not a certification authority</strong>" when trying to import it into Chrome.</li>
  <li>"<strong>subject alternative name missing</strong>" when using a certificate after importing its CA.</li>
  </ul>
  
  <p>I'm pretty sure I'm missing something in the process. Please, can anyone provide the valid configuration to handle alternative names along with the exact steps to create the corresponding CA and a certificate so that Chrome and Firefox can handle my local custom domain?</p>