From 6d7688e4f70900d19b69580552c0c4744d406baf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Sun, 30 Jun 2024 13:18:10 +0200 Subject: [PATCH] Use RemoteMediaDownloaderClient, not Tesla directly to use global ssl options --- lib/federation/activity_stream/converter/media.ex | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/federation/activity_stream/converter/media.ex b/lib/federation/activity_stream/converter/media.ex index a00d9ab1c..5af0d0485 100644 --- a/lib/federation/activity_stream/converter/media.ex +++ b/lib/federation/activity_stream/converter/media.ex @@ -9,13 +9,9 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Media do alias Mobilizon.Federation.ActivityStream alias Mobilizon.Medias alias Mobilizon.Medias.Media, as: MediaModel - + alias Mobilizon.Service.HTTP.RemoteMediaDownloaderClient alias Mobilizon.Web.Upload - @http_options [ - ssl: [{:versions, [:"tlsv1.2"]}] - ] - @doc """ Convert a media struct to an ActivityStream representation. """ @@ -65,7 +61,7 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Media do defp upload_media(media_url, ""), do: upload_media(media_url, "unknown") defp upload_media(media_url, name) do - case Tesla.get(media_url, opts: @http_options) do + case RemoteMediaDownloaderClient.get(media_url) do {:ok, %{body: body}} -> case Upload.store(%{body: body, name: name}) do {:ok, %{url: _url} = uploaded} ->