SSL.Protocol.HandshakeMachine (ex_ssl v0.16.7)

Copy Markdown View Source

Pure TLS client coordinator consuming one complete record at a time.

Summary

Types

event()

@type event() ::
  {:connected, binary() | nil} | {:application_data, binary()} | :closed

t()

@type t() ::
  %SSL.Protocol.HandshakeMachine{
    client_ast: term(),
    client_hello: term(),
    client_identity: term(),
    enable_tickets: term(),
    framer: term(),
    hrr: term(),
    hrr_transcript: term(),
    identity: term(),
    key_pair: term(),
    key_pairs: term(),
    negotiated_protocol: term(),
    offer: term(),
    options: term(),
    pending_tickets: term(),
    phase: term(),
    read_state: term(),
    resumed: term(),
    resumption_master: term(),
    server_hello: term(),
    ticket: term(),
    ticket_count: term(),
    trust_source: term(),
    verified_peer: term(),
    verifier: term(),
    write_state: term()
  }
  | SSL.Protocol.TLS12.t()

Functions

encrypt(state, type, data)

@spec encrypt(t(), :application_data | :alert, iodata()) ::
  {:ok, binary(), t()} | {:error, term()}

feed(state, record)

@spec feed(t(), binary()) ::
  {:ok, t(), [binary()], [event()]}
  | {:error, {:fatal_alert, atom(), term()} | {:peer_alert, byte(), byte()}}

init(materialized, trust_source, identity, opts \\ [])

@spec init(
  SSL.ClientHello.Materializer.Materialized.t(),
  term(),
  SSL.PKIX.identity(),
  keyword()
) ::
  {:ok, t(), [binary()]} | {:error, term()}