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

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

<h1>SSL_get_ex_data_X509_STORE_CTX_idx(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="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#EXAMPLES">EXAMPLES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
SSL_get_ex_data_X509_STORE_CTX_idx - get ex_data index to access SSL
structure from X509_STORE_CTX

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/ssl.h&gt;
</PRE>
<PRE> int SSL_get_ex_data_X509_STORE_CTX_idx(void);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>SSL_get_ex_data_X509_STORE_CTX_idx()</CODE> returns the index number
under which the pointer to the SSL object is stored into the X509_STORE_CTX
object.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
Whenever a X509_STORE_CTX object is created for the verification of the
peers certificate during a handshake, a pointer to the SSL object is stored
into the X509_STORE_CTX object to identify the connection affected. To
retrieve this pointer the <CODE>X509_STORE_CTX_get_ex_data()</CODE>
function can be used with the correct index. This index is globally the
same for all X509_STORE_CTX objects and can be retrieved using
<CODE>SSL_get_ex_data_X509_STORE_CTX_idx().</CODE> The index value is set
when <CODE>SSL_get_ex_data_X509_STORE_CTX_idx()</CODE> is first called
either by the application program directly or indirectly during other SSL
setup functions or during the handshake.

</P>
<P>
The value depends on other index values defined for X509_STORE_CTX objects
before the SSL index is created.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<DL>
<DT><STRONG><A NAME="item_gt">&gt;=0</A></STRONG><DD>
<P>
The index value to access the pointer.

</P>
<DT><STRONG><A NAME="item_lt0">&lt;0</A></STRONG><DD>
<P>
An error occurred, check the error stack for a detailed error message.

</P>
</DL>
<P>
<HR>
<H1><A NAME="EXAMPLES">EXAMPLES</A></H1>
<P>
The index returned from <CODE>SSL_get_ex_data_X509_STORE_CTX_idx()</CODE>
allows to access the SSL object for the connection to be accessed during
the <CODE>verify_callback()</CODE> when checking the peers certificate.
Please check the example in <A HREF="../ssl/SSL_CTX_set_verify.html#">SSL_CTX_set_verify(3)</A>,

</P>
<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_verify.html#">SSL_CTX_set_verify(3)</A>,
<A HREF="../crypto/CRYPTO_set_ex_data.html#">CRYPTO_set_ex_data(3)</A>



</P>
:}


