title: curl --cacert error "curl: (60) SSL: no alternative certificate subject name matches target host name"
body: <p><code>curl: (60) SSL: no alternative certificate subject name matches target host name</code></p>
  <p>I don't get this error. If I supply a <strong>CA</strong> certificate (with <code>--cacert</code> option), it doesn't even have a subject alternative name. And if it had one, it wouldn't match the target host name (my server) for sure.</p>
  <p>If I, on the other hand, supply my <em>server</em> certificate, signed with the <strong>CA</strong>, it says: <code>SSL certificate problem: unable to get local issuer certificate.</code> (That I would expect, because my computer does not trust the CA by default and that's correct.)</p>
  <p>When combining the PEM certificates in one file, I get the same errors.</p>
  <p>Using option <code>--capath</code> set to the directory with both <em>server</em> and <em>CA</em> certificates it says: <code>curl: (60) SSL certificate problem: unable to get local issuer certificate</code> again.</p>
  <p>How do I make the trust check work?</p>
  <p>(It worked when using a single self-signed server certificate.)</p>