
#use wml::openssl-macros area=docs page=SSL_load_client_CA_file

<title>Documents, SSL_load_client_CA_file(3)</title>

<h1>SSL_load_client_CA_file(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#EXAMPLES">EXAMPLES</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
SSL_load_client_CA_file - load certificate names from file

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/ssl.h&gt;
</PRE>
<PRE> STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>SSL_load_client_CA_file()</CODE> reads certificates from <STRONG>file</STRONG> and returns a <CODE>STACK_OF(X509_NAME)</CODE> with the subject names
found.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
<CODE>SSL_load_client_CA_file()</CODE> reads a file of PEM formatted
certificates and extracts the X509_NAMES of the certificates found. While
the name suggests the specific usage as support function for
<A HREF="../ssl/SSL_CTX_set_client_CA_list.html#">SSL_CTX_set_client_CA_list(3)</A>, it is not limited to CA certificates.

</P>
<P>
<HR>
<H1><A NAME="EXAMPLES">EXAMPLES</A></H1>
<P>
Load names of CAs from file and use it as a client CA list:

</P>
<PRE> SSL_CTX *ctx;
 STACK_OF(X509_NAME) *cert_names;
</PRE>
<PRE> ... 
 cert_names = SSL_load_client_CA_file(&quot;/path/to/CAfile.pem&quot;);
 if (cert_names != NULL)
   SSL_CTX_set_client_CA_list(ctx, cert_names);
 else
   error_handling();
 ...
</PRE>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
The following return values can occur:

</P>
<DL>
<DT><STRONG><A NAME="item_NULL">NULL</A></STRONG><DD>
<P>
The operation failed, check out the error stack for the reason.

</P>
<DT><STRONG><A NAME="item_Pointer">Pointer to STACK_OF(X509_NAME)</A></STRONG><DD>
<P>
Pointer to the subject names of the successfully read certificates.

</P>
</DL>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../ssl/ssl.html#">ssl(3)</A>,
<A HREF="../ssl/SSL_CTX_set_client_CA_list.html#">SSL_CTX_set_client_CA_list(3)</A>



</P>
:}


