SSL.Protocol.ServerHandshake (ex_ssl v1.0.0)

Copy Markdown View Source

Record-free TLS 1.3 full-certificate server handshake operations.

A non-nil config.transport_parameters selects QUIC rules: the ClientHello must carry ext 57 and ALPN and an empty legacy session id, and EncryptedExtensions echoes the local transport parameters. With nil (TCP), ALPN is optional and a middlebox-compatibility session id is echoed.

A non-nil config.client_auth on a full TCP handshake requests a client certificate (RFC 8446 §4.3.2). The phase then advances :client_certificate -> :client_certificate_verify -> :finished, and only :finished admits the client Finished.

Summary

Functions

Accepts the client Certificate answering a CertificateRequest.

Accepts the client CertificateVerify over the transcript through the client Certificate. Its scheme must be one the CertificateRequest offered.

Functions

accept_client_certificate(state, encoded)

@spec accept_client_certificate(SSL.Protocol.ServerHandshake.State.t(), binary()) ::
  {:ok, SSL.Protocol.ServerHandshake.State.t()} | {:error, term()}

Accepts the client Certificate answering a CertificateRequest.

An empty list is certificate_required when the certificate is required and otherwise skips CertificateVerify. A non-empty chain is validated against the configured trust anchors and depth, with no service identity check.

accept_client_certificate_verify(state, encoded)

@spec accept_client_certificate_verify(
  SSL.Protocol.ServerHandshake.State.t(),
  binary()
) ::
  {:ok, SSL.Protocol.ServerHandshake.State.t()} | {:error, term()}

Accepts the client CertificateVerify over the transcript through the client Certificate. Its scheme must be one the CertificateRequest offered.

accept_hello(config, encoded, previous)

@spec accept_hello(map(), binary(), SSL.Protocol.ServerHandshake.State.t() | nil) ::
  {:ok, SSL.Protocol.ServerHandshake.State.t()}
  | {:retry, SSL.Protocol.ServerHandshake.State.t(), binary()}
  | {:error, term()}

finish(state, encoded)

@spec finish(SSL.Protocol.ServerHandshake.State.t(), binary()) ::
  :ok | {:error, term()}

flight(state, config, pair, random)

@spec flight(
  SSL.Protocol.ServerHandshake.State.t(),
  map(),
  SSL.Crypto.KeyExchange.KeyPair.t(),
  binary()
) ::
  {:ok, SSL.Protocol.ServerHandshake.State.t(), binary(), [binary()]}
  | {:error, term()}

parameters(extensions)

@spec parameters(list()) :: {:ok, binary()} | {:error, term()}