[gnutls-help] Certificate callback questions

Lavrentiev, Anton (NIH/NLM/NCBI) [C] lavr at ncbi.nlm.nih.gov
Wed Apr 22 17:31:51 CEST 2015


Nikos,

Thank you for your response!

> You can still however differentiate between sessions using
> gnutls_session_set/get_ptr(). Do you see an issue with this approach?

I can, but the callback will be visited by all sessions that use that same
credentials.  BTW, could you please comment if the same credentials handle
can be shared / reused for multiple (possibly, concurrent) sessions?
It's unclear that it couldn't;  and it seems to work for me just fine.

> > to pass some context to a callback that is set with "gnutls_certificate_set_retrieve_function*()"?
> Since you get a pointer to the session you can use the
> gnutls_session_set/get_ptr() for that.

And this is just a reverse situation of the certificate verification callback:
it looks like retrieve is a method of credentials rather than a session.  If I could
treat the credentials as a container, and extract and return a suitable element out of
it (i.e. there can be a handle to a file, which keeps all available certs), I would not
want / need to give that handle to each and every session that use those credentials.

Thank you,

Anton Lavrentiev
Contractor NIH/NLM/NCBI



More information about the Gnutls-help mailing list