summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex S <alex.strizhakov@gmail.com>2019-08-23 17:12:43 +0300
committerAlex S <alex.strizhakov@gmail.com>2019-08-23 17:12:43 +0300
commit65fd5bdf4cd1f70edd8669f0c90fcc6d9b4385ff (patch)
tree5761cd2b2b3fc1fd1546c5acd3026875a3e9e002
parente34ca5174c6860cc97bed18d9baaece77687e23b (diff)
added tls_opts to connect method
-rw-r--r--lib/pleroma/gun/connections.ex5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pleroma/gun/connections.ex b/lib/pleroma/gun/connections.ex
index 6cec4277a..a0fa8e6eb 100644
--- a/lib/pleroma/gun/connections.ex
+++ b/lib/pleroma/gun/connections.ex
@@ -161,7 +161,9 @@ defmodule Pleroma.Gun.Connections do
result =
if opts[:proxy] do
with {proxy_host, proxy_port} <- opts[:proxy],
- {:ok, conn} <- API.open(proxy_host, proxy_port, opts),
+ tls_opts <- Map.get(opts, :tls_opts, []),
+ open_opts <- Map.delete(opts, :tls_opts),
+ {:ok, conn} <- API.open(proxy_host, proxy_port, open_opts),
{:ok, _} <- API.await_up(conn) do
connect_opts = %{host: host, port: port}
@@ -169,6 +171,7 @@ defmodule Pleroma.Gun.Connections do
if uri.scheme == "https" do
Map.put(connect_opts, :protocols, [:http2])
|> Map.put(:transport, :tls)
+ |> Map.put(:tls_opts, tls_opts)
else
connect_opts
end