OpenSSL has a generic IO interface; it is pretty easy, given all the openssl code we have already, to target it. Here's a partial patch to do that.
This is a potentially risky interface, since people using it might think
they're getting encryption when they aren't. This suggests that there should
be _another_ interface to creating one of these things that takes a BIO
rather than an fd or a bufferevent.
It needs testing and documentation.
The implementation of be_openssl_ctrl needs to get fixed.
Perhaps there should be a way to override the 'find the right bufferevent or
fd to use as our target' code.
see thread "libevent-2.0 and openssl filter" on libevent users, nov 2009.
Letting this languish until somebody needs it.