Fix cacerts for escript version (#2439)

This commit is contained in:
Alexandre de Souza 2024-01-23 18:37:00 -03:00 committed by GitHub
parent 03062f8d4f
commit 99bf5d02f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,8 +21,9 @@ defmodule Livebook.Teams.WebSocket do
uri = URI.parse(Livebook.Config.teams_url())
{http_scheme, ws_scheme} = parse_scheme(uri)
state = %{status: nil, headers: [], body: []}
opts = [protocols: [:http1], transport_opts: [cacerts: :public_key.cacerts_get()]]
with {:ok, conn} <- Mint.HTTP.connect(http_scheme, uri.host, uri.port, protocols: [:http1]),
with {:ok, conn} <- Mint.HTTP.connect(http_scheme, uri.host, uri.port, opts),
{:ok, conn, ref} <- Mint.WebSocket.upgrade(ws_scheme, conn, @ws_path, headers) do
receive_upgrade(conn, ref, state)
else