1503 fix ActivityPub publishing for self-signed CA certs

This commit is contained in:
André Menrath 2024-06-20 22:02:31 +02:00
parent 1217f8a777
commit b8b2e895b0

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,
json,
headers: [
{"Content-Type", "application/activity+json"}, {"Content-Type", "application/activity+json"},
{"signature", signature}, {"signature", signature},
{"digest", digest}, {"digest", digest},
{"date", date} {"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())}