From 65fd5bdf4cd1f70edd8669f0c90fcc6d9b4385ff Mon Sep 17 00:00:00 2001 From: Alex S Date: Fri, 23 Aug 2019 17:12:43 +0300 Subject: [PATCH] added tls_opts to connect method --- lib/pleroma/gun/connections.ex | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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