forked from AkkomaGang/akkoma
Merge branch 'fix-tlsv1.3' into 'develop'
Fix supported TLS versions as TLS 1.3 support seems buggy. Closes #708 See merge request pleroma/pleroma!892
This commit is contained in:
commit
46200d8fac
2 changed files with 15 additions and 1 deletions
|
@ -133,7 +133,14 @@
|
||||||
config :tesla, adapter: Tesla.Adapter.Hackney
|
config :tesla, adapter: Tesla.Adapter.Hackney
|
||||||
|
|
||||||
# Configures http settings, upstream proxy etc.
|
# Configures http settings, upstream proxy etc.
|
||||||
config :pleroma, :http, proxy_url: nil
|
config :pleroma, :http,
|
||||||
|
proxy_url: nil,
|
||||||
|
adapter: [
|
||||||
|
ssl_options: [
|
||||||
|
# We don't support TLS v1.3 yet
|
||||||
|
versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
config :pleroma, :instance,
|
config :pleroma, :instance,
|
||||||
name: "Pleroma",
|
name: "Pleroma",
|
||||||
|
|
|
@ -30,6 +30,7 @@ def request(method, url, body \\ "", headers \\ [], options \\ []) do
|
||||||
options =
|
options =
|
||||||
process_request_options(options)
|
process_request_options(options)
|
||||||
|> process_sni_options(url)
|
|> process_sni_options(url)
|
||||||
|
|> process_adapter_options()
|
||||||
|
|
||||||
params = Keyword.get(options, :params, [])
|
params = Keyword.get(options, :params, [])
|
||||||
|
|
||||||
|
@ -56,6 +57,12 @@ defp process_sni_options(options, url) do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def process_adapter_options(options) do
|
||||||
|
adapter_options = Pleroma.Config.get([:http, :adapter], [])
|
||||||
|
|
||||||
|
options ++ [adapter: adapter_options]
|
||||||
|
end
|
||||||
|
|
||||||
def process_request_options(options) do
|
def process_request_options(options) do
|
||||||
config = Application.get_env(:pleroma, :http, [])
|
config = Application.get_env(:pleroma, :http, [])
|
||||||
proxy = Keyword.get(config, :proxy_url, nil)
|
proxy = Keyword.get(config, :proxy_url, nil)
|
||||||
|
|
Loading…
Reference in a new issue