Tls

This PR adds TLS support using ocaml-tls. Due to reindentation of the modified code with ocaml-indent, the changeset is a bit hard to read, sorry about that.
On 28/08/2014 01:02, mfp wrote:
> Is there any particular reason to close the channel here (note that the fd is
> closed below in L469)?
> In order to get a socket shutdown(2) (doesn't closing the fd imply shutdown
> SHUT_RDWR?)?

Yes, when using TLS, you need to advertise you're closing the connection, and
that magic is done by a function automatically called by Lwt_io.close (which
call I believe Tls_lwt.Unix.close).

So when using TLS, one need to call Lwt_io.close.

As for shutdown(2), yes, there is _no point_ calling shutdown on a fd one want
to close.

So this is the point of this code, now there might be a way to write that in a
better way.