# `SSL.Protocol.ServerHandshake`
[🔗](https://github.com/gsmlg-dev/http_fetch/blob/v1.0.0/apps/ex_ssl/lib/ssl/protocol/server_handshake.ex#L1)

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.

# `accept_client_certificate`

```elixir
@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`

```elixir
@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`

```elixir
@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`

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

# `flight`

```elixir
@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`

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
