I was recently writing a toy Gemini server, for which you need TLS 1.2/3 + SNI and after bouncing off various options ending up using libtls from libressl.
I wrote some Zig bindings, and ended up wrapping it into a separate repo.
It’s “support” lifetime is almost certainly measured in weeks, before I get bored of my toy server, but maybe someone would use it as a starting point.
special thanks to torque on github, who already did the actually hard work of building libressl with build.zig GitHub - allyourcodebase/libressl
I think I got off easy here, there’s just the 2 callbacks and I think the lifetime is relatively clear for this library (though mostly not documented…).
I have just added an example which uses the callbacks, in this case it’s to wed the TLS with a very much async completion-based event loop (libxev)
It’s fairly gnarly, and probably a good reason not to use a proactor loop for such stuff, but I wanted at least one example of why you’d use the callback mechanism.