Preferred way of passing user context void* inside SSL*

Viktor Dukhovni openssl-users at
Wed Oct 23 15:57:55 UTC 2019

On Wed, Oct 23, 2019 at 01:21:54PM +0000, Salz, Rich via openssl-users wrote:

> >    Is there a way for me to piggyback a void* inside the SSL structure so
>     that I can access it from within the callback?
> Yes, you can use SSL_set_app_data and SSL_get_app_data which are documented
> in (and due to be merged to
> master soon)

If the data is needed by a *library* and not "the application",
then it is not appropriate to use index 0, which is reserved for
"the application".  In that case, the library needs to register its
own "ex data index".  Examples can be seen at:

1-time init:
Setter usage:
Getter usage:


More information about the openssl-users mailing list