I have a multithreaded application that makes heavy use of OpenSSL in C. It is designed with the idea that all of its SSL connections are expected to block. Specifically, bl
I did non-blocking SSL connections in my own "lion" code, but I did not use the BIO functionality in OpenSSL at all.
Rather, I went for the calls
SSL_set_fd(ctx, fd ) and SSL_get_fd(ssl) to handle my own fdsets and calling select.
The biggest 'gotcha' that took a while to track down was to set SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER and SSL_MODE_ENABLE_PARTIAL_WRITE for it work the way I wanted.
If you want to read the SSL part of the code, it is here:
https://github.com/lundman/lion/blob/master/src/tls.c