title: Verify a certificate chain using openssl verify
body: <p>I'm building a own certificate chain with following componenents:</p>
  
  <pre><code>Root Certificate - Intermediate Certificate - User Certificate
  </code></pre>
  
  <p>Root Cert is a self signed certificate, Intermediate Certificate is signed by Root and User by Intermediate. </p>
  
  <p>Now I want to verify if a User Certificate has its anchor by Root Certificate.</p>
  
  <p>With</p>
  
  <pre><code>openssl verify -verbose -CAfile RootCert.pem Intermediate.pem
  </code></pre>
  
  <p>the validation is ok. In the next step I validate the User Cert with</p>
  
  <pre><code>openssl verify -verbose -CAfile Intermediate.pem UserCert.pem
  </code></pre>
  
  <p>and the validation shows</p>
  
  <pre><code>error 20 at 0 depth lookup:unable to get local issuer certificate
  </code></pre>
  
  <p>What is wrong?</p>