> Sometimes it is needed to do something with errors during X.509
> certificate validation. For example, collect all error messages
> in some memory space.
> Unfortunately, verify callback function only takes preverify status
> and a pointer to X509_STORE structure. If this structure had some
> "void* userdata" field - it would be possible to do it without using
> global variables.
Use the ex_data structure. Some very simple code to get an appropriate
index, store data and retreive it: