I’m looking for examples of setting up TLS connections. I’m using ianic/tls.zig for this, but i’m having errors that i do not understand when trying to write after reading.
The standard library seems to have a highly optimized implementation for http, which i’m having difficulty understanding and adapting.
Does anyone have any pointer to examples setting up tls connections for non-http, long-lived connections?
Which version of Zig? If you are on 0.15.2, I have a setup in my Chamaileon repo where I connect to a TCP socket and then wrap a TLS connection around it.
With the new Reader/Writer interfaces, it can be a little complicated initially to set up the buffers you need.
You need one read/write pair for the socket, and one read/write pair for the ciphertext parts.
I believe this should also work for 0.16.0-dev, but I have not tested it.