From b8b2e895b0a6e99d1ffd9b11e900783e5210325c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Thu, 20 Jun 2024 22:02:31 +0200 Subject: [PATCH] 1503 fix ActivityPub publishing for self-signed CA certs --- lib/federation/activity_pub/publisher.ex | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/federation/activity_pub/publisher.ex b/lib/federation/activity_pub/publisher.ex index 257a2f6be..2b3d2629a 100644 --- a/lib/federation/activity_pub/publisher.ex +++ b/lib/federation/activity_pub/publisher.ex @@ -7,6 +7,7 @@ defmodule Mobilizon.Federation.ActivityPub.Publisher do alias Mobilizon.Config alias Mobilizon.Federation.ActivityPub.{Activity, Federator, Relay, Transmogrifier, Visibility} alias Mobilizon.Federation.HTTPSignatures.Signature + alias Mobilizon.Service.HTTP.ActivityPub, as: ActivityPubClient require Logger import Mobilizon.Federation.ActivityPub.Utils, @@ -95,16 +96,16 @@ defmodule Mobilizon.Federation.ActivityPub.Publisher do date: date }) - Tesla.post( - inbox, - json, - headers: [ - {"Content-Type", "application/activity+json"}, - {"signature", signature}, - {"digest", digest}, - {"date", date} - ] - ) + headers = [ + {"Content-Type", "application/activity+json"}, + {"signature", signature}, + {"digest", digest}, + {"date", date} + ] + + client = ActivityPubClient.client(headers: headers) + + ActivityPubClient.post(client, inbox, json) end @spec convert_followers_in_recipients(list(String.t())) :: {list(String.t()), list(String.t())}