Show a dynamically updated list of NTS servers #1

Merged
mike merged 21 commits from liveview into main 2024-07-26 09:35:19 -04:00
1 changed files with 10 additions and 6 deletions
Showing only changes of commit 3c3d078c4d - Show all commits

View File

@ -33,12 +33,16 @@ defmodule Chronoscope.NTS.KeyEstablishmentClient do
end
defp perform_key_establishment(socket) do
:ok = @ssl.send(socket, KeyEstablishmentRequest.create())
{:ok, peercert} = @ssl.peercert(socket)
with :ok <- @ssl.send(socket, KeyEstablishmentRequest.create()),
{:ok, peercert} <- @ssl.peercert(socket) do
peercert
|> await_response()
|> tap(fn _ -> @ssl.close(socket) end)
else
e ->
@ssl.close(socket)
{:error, e}
end
end
defp await_response(peercert) do