Merge branch 'hackney_reenable_TLSv1.3' into 'develop'

hackney adapter helper: enable TLSv1.3

See merge request pleroma/pleroma!3661
This commit is contained in:
lain 2022-06-06 11:36:21 +00:00
commit 75f912c63f
5 changed files with 6 additions and 10 deletions

View File

@ -2726,7 +2726,7 @@ config :pleroma, :config_description, [
key: :versions, key: :versions,
type: {:list, :atom}, type: {:list, :atom},
description: "List of TLS version to use", description: "List of TLS version to use",
suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"] suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2", ":tlsv1.3"]
} }
] ]
} }

View File

@ -24,10 +24,6 @@ defmodule Pleroma.HTTP.AdapterHelper.Hackney do
|> Pleroma.HTTP.AdapterHelper.maybe_add_proxy(proxy) |> Pleroma.HTTP.AdapterHelper.maybe_add_proxy(proxy)
end end
defp add_scheme_opts(opts, %URI{scheme: "https"}) do
Keyword.put(opts, :ssl_options, versions: [:"tlsv1.2", :"tlsv1.1", :tlsv1])
end
defp add_scheme_opts(opts, _), do: opts defp add_scheme_opts(opts, _), do: opts
defp maybe_add_with_body(opts) do defp maybe_add_with_body(opts) do

View File

@ -7,7 +7,6 @@ defmodule Pleroma.ReverseProxy.Client.Hackney do
@impl true @impl true
def request(method, url, headers, body, opts \\ []) do def request(method, url, headers, body, opts \\ []) do
opts = Keyword.put(opts, :ssl_options, versions: [:"tlsv1.2", :"tlsv1.1", :tlsv1])
:hackney.request(method, url, headers, body, opts) :hackney.request(method, url, headers, body, opts)
end end

View File

@ -238,10 +238,11 @@ defmodule Pleroma.ConfigDBTest do
end end
test "ssl options" do test "ssl options" do
assert ConfigDB.to_elixir_types([":tlsv1", ":tlsv1.1", ":tlsv1.2"]) == [ assert ConfigDB.to_elixir_types([":tlsv1", ":tlsv1.1", ":tlsv1.2", ":tlsv1.3"]) == [
:tlsv1, :tlsv1,
:"tlsv1.1", :"tlsv1.1",
:"tlsv1.2" :"tlsv1.2",
:"tlsv1.3"
] ]
end end

View File

@ -86,7 +86,7 @@ defmodule Pleroma.Docs.GeneratorTest do
key: :versions, key: :versions,
type: {:list, :atom}, type: {:list, :atom},
description: "List of TLS version to use", description: "List of TLS version to use",
suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2"] suggestions: [:tlsv1, ":tlsv1.1", ":tlsv1.2", ":tlsv1.3"]
} }
] ]
}, },
@ -213,7 +213,7 @@ defmodule Pleroma.Docs.GeneratorTest do
test "suggestion for tls versions" do test "suggestion for tls versions" do
[%{children: children} | _] = Generator.convert_to_strings(@descriptions) [%{children: children} | _] = Generator.convert_to_strings(@descriptions)
child = Enum.at(children, 8) child = Enum.at(children, 8)
assert child[:suggestions] == [":tlsv1", ":tlsv1.1", ":tlsv1.2"] assert child[:suggestions] == [":tlsv1", ":tlsv1.1", ":tlsv1.2", ":tlsv1.3"]
end end
test "subgroup with module name" do test "subgroup with module name" do