fix(http): keep the configured TLS options with Gun
[:http, :adapter, :ssl_options] is Hackney's key, and AdminFE sets it. Gun reads tls_opts, so with Gun as the default these settings were lost without a warning. Use them as tls_opts unless tls_opts is set.
This commit is contained in:
parent
b2e4580a81
commit
532762bd9b
2 changed files with 19 additions and 0 deletions
|
|
@ -50,6 +50,15 @@ defmodule Pleroma.HTTP.AdapterHelper.GunTest do
|
|||
assert Keyword.has_key?(defaults, :b)
|
||||
end
|
||||
|
||||
test "uses Hackney's ssl_options from the config as Gun's tls_opts" do
|
||||
clear_config([:http, :adapter], ssl_options: [versions: [:"tlsv1.3"]])
|
||||
|
||||
opts = Gun.options([], URI.parse("https://example.com"))
|
||||
|
||||
assert opts[:tls_opts] == [versions: [:"tlsv1.3"]]
|
||||
refute Keyword.has_key?(opts, :ssl_options)
|
||||
end
|
||||
|
||||
test "parses string proxy host & port" do
|
||||
clear_config([:http, :proxy_url], "localhost:8123")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue