Show a dynamically updated list of NTS servers #1
|
@ -33,12 +33,16 @@ defmodule Chronoscope.NTS.KeyEstablishmentClient do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp perform_key_establishment(socket) do
|
defp perform_key_establishment(socket) do
|
||||||
:ok = @ssl.send(socket, KeyEstablishmentRequest.create())
|
with :ok <- @ssl.send(socket, KeyEstablishmentRequest.create()),
|
||||||
{:ok, peercert} = @ssl.peercert(socket)
|
{:ok, peercert} <- @ssl.peercert(socket) do
|
||||||
|
|
||||||
peercert
|
peercert
|
||||||
|> await_response()
|
|> await_response()
|
||||||
|> tap(fn _ -> @ssl.close(socket) end)
|
|> tap(fn _ -> @ssl.close(socket) end)
|
||||||
|
else
|
||||||
|
e ->
|
||||||
|
@ssl.close(socket)
|
||||||
|
{:error, e}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp await_response(peercert) do
|
defp await_response(peercert) do
|
||||||
|
|
Loading…
Reference in New Issue