title: openSSL: How to create a CAfile
body: <p>I want the client to send the server a certificate. Now, I'd like to use code that looks like this:</p>
  
  <pre><code>   SSL_CTX *ctx;
     STACK_OF(X509_NAME) *cert_names;
     ... 
     cert_names = SSL_load_client_CA_file("/path/to/CAfile.pem");
     if (cert_names != NULL)
         SSL_CTX_set_client_CA_list(ctx, cert_names);
     else
         error_handling();
     ...
  </code></pre>
  
  <p>But how do I create a CAfile? Also, if I want to specify only one particular CA, what command do I use to send that?</p>
  
  <p>I've read up on <code>SSL_CTX_set_client_CA_list(SSL_CTX *ctx,STACK_OF(X509_NAME) *list);</code>, but I don't know how to obtain that <code>*list</code> parameter. In this case, I have only 1 single CA.  </p>