sni option if we open connection in gun pool

This commit is contained in:
Alex S 2019-08-20 18:06:08 +03:00
parent 50bc6c5ea9
commit 6f08e77269

View File

@ -36,6 +36,19 @@ defmodule Pleroma.Gun.Connections do
do: Map.put(opts, :transport, :tls),
else: opts
opts =
if uri.scheme == "https" do
host = uri.host |> to_charlist()
tls_opts =
Map.get(opts, :tls_opts, [])
|> Keyword.put(:server_name_indication, host)
Map.put(opts, :tls_opts, tls_opts)
else
opts
end
GenServer.call(
name,
{:conn, %{opts: opts, uri: uri}}