Background
We want to add TLS support without blocking socket I/O. The plan is to:
- Use io_uring for non-blocking recv/send on sockets.
- Use OpenSSL for TLS handshake + encryption/decryption.
- Connect them via memory BIO (BIO_s_mem) so OpenSSL never reads/writes the socket directly.
Goals
- Implement TLS for connections while keeping the networking stack fully io_uring-driven.
- Support non-blocking:
- handshake
- application reads (decrypt)
- application writes (encrypt)
- graceful shutdown (TLS close_notify)
Proposed Design
- Per-connection state
- SSL* ssl
- BIO* rbio (input: ciphertext from socket)
- BIO* wbio (output: ciphertext to socket)
- recv_buf for ciphertext
- send_buf for unencrypted data