title: Verify a certificate chain in STACK_OF(X509)
body: <p>So I have a certificate chain stored in STACK_OF(X509). 
  This is what I did with it : </p>
  
  <pre><code>STACK_OF(X509) *chain = SSL_get_peer_cert_chain(ssl);
  
  X509_STORE_CTX* newCert = X509_STORE_CTX_new();
  if(newCert){
      X509_STORE_CTX_set_chain(newCert, chain);
      std::cout &lt;&lt; X509_verify_cert(newCert) &lt;&lt; std::endl;
  }
  std::cout &lt;&lt; "ERROR : " &lt;&lt; X509_STORE_CTX_get_error(newCert) &lt;&lt; std::endl;
  </code></pre>
  
  <p>The issue is that the <code>X509_verify_cert(newCert)</code> returns -1 meaning the initialization of the <code>X509_STORE_CTX</code> was not down properly. What am I missing?</p>