sni option if we open connection in gun pool
This commit is contained in:
parent
50bc6c5ea9
commit
6f08e77269
@ -36,6 +36,19 @@ defmodule Pleroma.Gun.Connections do
|
|||||||
do: Map.put(opts, :transport, :tls),
|
do: Map.put(opts, :transport, :tls),
|
||||||
else: opts
|
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(
|
GenServer.call(
|
||||||
name,
|
name,
|
||||||
{:conn, %{opts: opts, uri: uri}}
|
{:conn, %{opts: opts, uri: uri}}
|
||||||
|
Loading…
Reference in New Issue
Block a user