Module Bytesrw_tls.Info

TLS connection information.

Warning. Connection information is available only while the connection is active. Trying to access it afterwards raises Invalid_argument.

type t

The type for information about TLS connections.

val tls_version : t -> Conf.tls_version option

tls_version i is the TLS version used by the connection.

val alpn_protocol : t -> string option

alpn_protocol i is the name of the negociated application layer protocol (if any).

val peer_cert : t -> X509_certchain.t option

peer_cert i is the certificate of the peer, if available.

Formatting

val pp : Stdlib.Format.formatter -> t -> unit

pp formats connection information for inspection.

val pp_peer_cert : Stdlib.Format.formatter -> t -> unit

pp_peer_cert formats the peer certificate for inspection or a message if there is none.

val pp_peer_cert_pem : Stdlib.Format.formatter -> t -> unit

pp_peer_cert_pem formats the peer certificate in PEM or a message if there is none.