ellzey/libevhtp — pull request #28 by ahochhaus (2011-12-30 23:49:40+00:00)
Title: More flexible SSL initialization.

The current evhtp_ssl_init interface is nice in that client code can avoid
directly setting up an SSL_CTX, however it only provides a subset of the
flexibility of creating a custom SSL_CTX. For example, client code could want
to setup multiple https servers from inside the same process space [in which
case SSL_library_init() should only be called once I think] or use a
certificate format other than pem files.

This change exposes a middle of the road solution:

a) allow full ssl configuration via evhtp_ssl_cfg_t (as currently exists)

b) allow client code to create a custom SSL_CTX and complete a user specified
sub-set of the SSL initialization sequence inside evhtp_ssl_init.

I uncrustified this change so hopefully it does not need reformatting.

I'm not certain that this is the best possible interface. It seems like allowing the user to do custom SSL initialization (directly via OpenSSL) is a nice option if possible. Otherwise, it will be really tempting over time to try to pack many different configurations into evhtp_ssl_cfg_t. Do you have any thoughts about the best way to expose this interface?