Library
Module
Module type
Parameter
Class
Class type
TLS module given a flow
module F : Mirage_flow_lwt.S
module FLOW = F
type error = [
| `Tls_alert of Tls.Packet.alert_type
| `Tls_failure of Tls.Engine.failure
| `Read of F.error
| `Write of F.write_error
]
possible errors: incoming alert, processing failure, or a problem in the underlying flow.
The type for write errors.
type +'a io = 'a Lwt.t
we provide the FLOW interface
include Mirage_flow_lwt.S
with type 'a io := 'a io
and type buffer := buffer
and type error := error
and type write_error := write_error
val pp_error : error Fmt.t
val pp_write_error : write_error Fmt.t
val write : flow -> buffer -> (unit, write_error) Stdlib.result io
val writev : flow -> buffer list -> (unit, write_error) Stdlib.result io
val reneg :
?authenticator:X509.Authenticator.t ->
?acceptable_cas:X509.Distinguished_name.t list ->
?cert:Tls.Config.own_cert ->
?drop:bool ->
flow ->
(unit, write_error) Stdlib.result Lwt.t
reneg ~authenticator ~acceptable_cas ~cert ~drop t
renegotiates the session, and blocks until the renegotiation finished. Optionally, a new authenticator
and acceptable_cas
can be used. The own certificate can be adjusted by cert
. If drop
is true
(the default), application data received before the renegotiation finished is dropped.
val client_of_flow :
?trace:tracer ->
Tls.Config.client ->
?host:string ->
FLOW.flow ->
(flow, write_error) Stdlib.result Lwt.t
client_of_flow ~trace client ~host flow
upgrades the existing connection to TLS using the client
configuration, using host
as peer name.
val server_of_flow :
?trace:tracer ->
Tls.Config.server ->
FLOW.flow ->
(flow, write_error) Stdlib.result Lwt.t
server_of_flow ?tracer server flow
upgrades the flow to a TLS connection using the server
configuration.
val epoch : flow -> (Tls.Core.epoch_data, unit) Stdlib.result
epoch flow
extracts information of the established session.