Merge branch '1503-fix-ActivityPub-publishing-for-self-signed-CA-certs' into 'main'

1503 fix ActivityPub publishing for self-signed CA certs

See merge request framasoft/mobilizon!1567
This commit is contained in:
setop 2024-06-26 11:28:31 +00:00
commit 30d9778070

View file

@ -7,6 +7,7 @@ defmodule Mobilizon.Federation.ActivityPub.Publisher do
alias Mobilizon.Config alias Mobilizon.Config
alias Mobilizon.Federation.ActivityPub.{Activity, Federator, Relay, Transmogrifier, Visibility} alias Mobilizon.Federation.ActivityPub.{Activity, Federator, Relay, Transmogrifier, Visibility}
alias Mobilizon.Federation.HTTPSignatures.Signature alias Mobilizon.Federation.HTTPSignatures.Signature
alias Mobilizon.Service.HTTP.ActivityPub, as: ActivityPubClient
require Logger require Logger
import Mobilizon.Federation.ActivityPub.Utils, import Mobilizon.Federation.ActivityPub.Utils,
@ -95,16 +96,16 @@ defmodule Mobilizon.Federation.ActivityPub.Publisher do
date: date date: date
}) })
Tesla.post( headers = [
inbox, {"Content-Type", "application/activity+json"},
json, {"signature", signature},
headers: [ {"digest", digest},
{"Content-Type", "application/activity+json"}, {"date", date}
{"signature", signature}, ]
{"digest", digest},
{"date", date} client = ActivityPubClient.client(headers: headers)
]
) ActivityPubClient.post(client, inbox, json)
end end
@spec convert_followers_in_recipients(list(String.t())) :: {list(String.t()), list(String.t())} @spec convert_followers_in_recipients(list(String.t())) :: {list(String.t()), list(String.t())}