tls

Transport Layer Security purely in OCaml
Library tls.lwt
Module Tls_lwt
exception Tls_alert of Tls.Packet.alert_type

Tls_alert exception received from the other endpoint

exception Tls_failure of Tls.Engine.failure

Tls_failure exception while processing incoming data

module Unix : sig ... end

Low-level API

High-level API

accept_ext server fd is (ic, oc), sockaddr, the input and output channel from an accepted connection on the given fd, after upgrading to TLS using the server configuration.

accept own_cert fd is (ic, oc), sockaddr, the input and output channel from the accepted connection on fd, using the default configuration with the given own_cert.

val connect_ext : Tls.Config.client -> (string * int) -> (ic * oc) Lwt.t

connect_ext client (host, port) is ic, oc, the input and output channel of a TLS connection to host on port using the client configuration.

val connect : X509.Authenticator.t -> (string * int) -> (ic * oc) Lwt.t

connect authenticator (host, port) is ic, oc, the input and output channel of a TLS connection to host on port using the default configuration and the authenticator.

val of_t : ?close:( unit -> unit Lwt.t ) -> Unix.t -> ic * oc

of_t t is ic, oc, the input and output channel. close defaults to !Unix.close.