title: Selfsigned SSL multidomain certificates
body: <p>My main goal is to create a self-signed certificate for two domains:</p>
  
  <ul>
  <li>mydomain.com </li>
  <li>www.mydomain.com</li>
  </ul>
  
  <p>I've already followed some tutorials using the req_v3 and this is a sample of generated csr file:</p>
  
  <pre><code>    Attributes:
          challengePassword        :unable to print attribute
      Requested Extensions:
          X509v3 Basic Constraints: 
              CA:FALSE
          X509v3 Key Usage: 
              Digital Signature, Non Repudiation, Key Encipherment
          X509v3 Subject Alternative Name: 
              DNS:mydomain.com, DNS:www.mydomain.com
  Signature Algorithm: sha256WithRSAEncryption
       7a:5f:85:9f:8f:00:01:8a:c4:a4:bf:8a:fe:a9:70:f2:94:db:
       e2:e7:03:68:33:29:50:10:9c:54:36:e1:24:52:b5:c3:ae:1d:
  </code></pre>
  
  <p>When I try to access to mydomain.com the only warning browser shows me is that is not a trusted certificate, of course because is self-signed, I'm ok with that.</p>
  
  <p>The problem is when I try to access to www.mydomain.com, apart of not trusted certificate warning, it also shows me that server certificate does not include an id which matches the server name.</p>
  
  <p>Here is a my vhost configuration file:
  <a href="http://codeshare.io/VtBOQ" rel="nofollow">http://codeshare.io/VtBOQ</a></p>