---
name: "libressl-SSL_get_ex_data_X509_STORE_CTX_idx"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-SSL_get_ex_data_X509_STORE_CTX_idx"
---

# libressl-SSL\_get\_ex\_data\_X509\_STORE\_CTX\_idx(3)

get ex\_data index to access SSL structure from X509\_STORE\_CTX

## NAME

**SSL\_get\_ex\_data\_X509\_STORE\_CTX\_idx** – get ex\_data index to access SSL structure from X509\_STORE\_CTX

## SYNOPSIS

SSL Library (libssl, -lssl) libcrypto

**#include \<openssl/ssl.h\>**

*int*\

**SSL\_get\_ex\_data\_X509\_STORE\_CTX\_idx**(*void*);

## DESCRIPTION

**SSL\_get\_ex\_data\_X509\_STORE\_CTX\_idx**() returns the index number under which the pointer to the *SSL* object is stored into the *X509\_STORE\_CTX* object.

Whenever an *X509\_STORE\_CTX* object is created for the verification of the peer's 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 X509\_STORE\_CTX\_get\_ex\_data(3) 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 **SSL\_get\_ex\_data\_X509\_STORE\_CTX\_idx**(). The index value is set when **SSL\_get\_ex\_data\_X509\_STORE\_CTX\_idx**() is first called either by the application program directly or indirectly during other SSL setup functions or during the handshake.

The value depends on other index values defined for *X509\_STORE\_CTX* objects before the SSL index is created.

## RETURN VALUES

- ≥0

  The index value to access the pointer.

- \<0

  An error occurred, check the error stack for a detailed error message.

## EXAMPLES

The index returned from **SSL\_get\_ex\_data\_X509\_STORE\_CTX\_idx**() provides access to *SSL* object for the connection during the **verify\_callback**() when checking the peer's certificate. Check the example in SSL\_CTX\_set\_verify(3).

## SEE ALSO

CRYPTO\_set\_ex\_data(3), [ssl(3)](/ssl/3.md), SSL\_CTX\_set\_verify(3)

## HISTORY

**SSL\_get\_ex\_data\_X509\_STORE\_CTX\_idx**() first appeared in SSLeay 0.9.1 and has been available since OpenBSD 2.6.
