pleroma/lib/pleroma
Pierre-Louis Bonicoli 05c21ac191
hackney adapter helper & reverse proxy client: enable TLSv1.3
The list of TLS versions was added by
8bd2b6eb13 when hackney version was
pinned to 1.15.2. Later hackney version was upgraded
(166455c884) but the list of TLS
versions wasn't removed. From the hackney point of view, this list has
been replaced by the OTP defaults since 0.16.0
(734694ea4e24f267864c459a2f050e943adc6694).

It looks like the same issue already occurred before:
0cb7b0ea84.

A way to test this issue (where example.com is an ActivityPub site
which uses TLSv1.3 only):

   $ PLEROMA_CONFIG_PATH=/path/to/config.exs pleroma start_iex
   Erlang/OTP 22 [erts-10.7.2.16] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]

   Erlang/OTP 22 [erts-10.7.2.16] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]

   Interactive Elixir (1.10.4) - press Ctrl+C to exit (type h() ENTER for help)
   iex(pleroma@127.0.0.1)2> Pleroma.Object.Fetcher.fetch_and_contain_remote_object_from_id("https://example.com/@/Nick/")
   {:error,
    {:tls_alert,
     {:protocol_version,
      'TLS client: In state hello received SERVER ALERT: Fatal - Protocol Version\n'}}}

With this patch, the output is the expected one:

   iex(pleroma@127.0.0.1)3> Pleroma.Object.Fetcher.fetch_and_contain_remote_object_from_id("https://example.com/@/Nick/")
   {:error,
   {:ok,
    %{
      "@context" => [
        "https://www.w3.org/ns/activitystreams",
        "https://w3id.org/security/v1",
        %{
          "Emoji" => "toot:Emoji",
          "Hashtag" => "as:Hashtag",
          "atomUri" => "ostatus:atomUri",
          "conversation" => "ostatus:conversation",
          "featured" => "toot:featured",
          "focalPoint" => %{"@container" => "@list", "@id" => "toot:focalPoint"},
          "inReplyToAtomUri" => "ostatus:inReplyToAtomUri",
          "manuallyApprovesFollowers" => "as:manuallyApprovesFollowers",
          "movedTo" => "as:movedTo",
          "ostatus" => "http://ostatus.org#",
          "sensitive" => "as:sensitive",
          "toot" => "http://joinmastodon.org/ns#"
        }
      ],
      "endpoints" => %{"sharedInbox" => "https://example.com/inbox"},
      "followers" => "https://example.com/@/Nick/followers",
      "following" => nil,
      "icon" => %{
        "type" => "Image",
        "url" => "https://example.com/static/media/[...].png"
      },
      "id" => "https://example.com/@/Nick/",
      "inbox" => "https://example.com/@/Nick/inbox",
      "liked" => nil,
      "name" => "Nick",
      "outbox" => "https://example.com/@/Nick/outbox",
      "preferredUsername" => "Nick",
      "publicKey" => %{
        "id" => "https://example.com/@/Nick/#main-key",
        "owner" => "https://example.com/@/Nick/",
        "publicKeyPem" => "[...]
      },
      "summary" => "",
      "type" => "Person",
      "url" => "https://example.com/@/Nick/"
    }}

A way to test the reverse proxy bits of this issue (where example.com allows TLSv1.3 only):

    iex(pleroma@127.0.0.1)1> Pleroma.ReverseProxy.Client.Hackney.request("GET", "https://example.com", [], [])
    {:error,
     {:tls_alert,
      {:protocol_version,
       'TLS client: In state hello received SERVER ALERT: Fatal - Protocol Version\n'}}}
2022-06-11 13:59:14 +02:00
..
activity Update copyright, also 2022-02-12 11:53:32 -06:00
bbs Update copyright, also 2022-02-12 11:53:32 -06:00
captcha Update copyright, also 2022-02-12 11:53:32 -06:00
chat Update copyright, also 2022-02-12 11:53:32 -06:00
config Update copyright, also 2022-02-12 11:53:32 -06:00
conversation Update copyright, also 2022-02-12 11:53:32 -06:00
docs Update copyright, also 2022-02-12 11:53:32 -06:00
ecto_type Update copyright, also 2022-02-12 11:53:32 -06:00
emails Send emails i18n'd using backend-stored user language 2022-05-09 10:44:43 -05:00
emoji Update copyright, also 2022-02-12 11:53:32 -06:00
gopher Update copyright, also 2022-02-12 11:53:32 -06:00
gun Update copyright, also 2022-02-12 11:53:32 -06:00
helpers Update copyright, also 2022-02-12 11:53:32 -06:00
http hackney adapter helper & reverse proxy client: enable TLSv1.3 2022-06-11 13:59:14 +02:00
instances Update copyright, also 2022-02-12 11:53:32 -06:00
mfa Update copyright, also 2022-02-12 11:53:32 -06:00
migration_helper Update copyright, also 2022-02-12 11:53:32 -06:00
migrators Update copyright, also 2022-02-12 11:53:32 -06:00
object Update copyright, also 2022-02-12 11:53:32 -06:00
password Update copyright, also 2022-02-12 11:53:32 -06:00
reverse_proxy hackney adapter helper & reverse proxy client: enable TLSv1.3 2022-06-11 13:59:14 +02:00
telemetry Update copyright, also 2022-02-12 11:53:32 -06:00
tesla/middleware Update copyright, also 2022-02-12 11:53:32 -06:00
tests Update copyright, also 2022-02-12 11:53:32 -06:00
upload Update copyright, also 2022-02-12 11:53:32 -06:00
uploaders Update copyright, also 2022-02-12 11:53:32 -06:00
user Update copyright, also 2022-02-12 11:53:32 -06:00
web Add more reacts to MRF 2022-05-30 15:36:54 +02:00
workers Update copyright, also 2022-02-12 11:53:32 -06:00
activity.ex Update copyright, also 2022-02-12 11:53:32 -06:00
application.ex Update copyright, also 2022-02-12 11:53:32 -06:00
application_requirements.ex Update copyright, also 2022-02-12 11:53:32 -06:00
bookmark.ex Update copyright, also 2022-02-12 11:53:32 -06:00
caching.ex Update copyright, also 2022-02-12 11:53:32 -06:00
captcha.ex Update copyright, also 2022-02-12 11:53:32 -06:00
chat.ex Update copyright, also 2022-02-12 11:53:32 -06:00
clippy.ex Update copyright, also 2022-02-12 11:53:32 -06:00
config.ex Update copyright, also 2022-02-12 11:53:32 -06:00
config_db.ex Update copyright, also 2022-02-12 11:53:32 -06:00
constants.ex Update copyright, also 2022-02-12 11:53:32 -06:00
conversation.ex Update copyright, also 2022-02-12 11:53:32 -06:00
counter_cache.ex Update copyright, also 2022-02-12 11:53:32 -06:00
data_migration.ex Update copyright, also 2022-02-12 11:53:32 -06:00
delivery.ex Update copyright, also 2022-02-12 11:53:32 -06:00
ecto_enums.ex Update copyright, also 2022-02-12 11:53:32 -06:00
emoji-test.txt Unicode 14.0 support 2022-02-21 12:16:06 -06:00
emoji.ex Update copyright, also 2022-02-12 11:53:32 -06:00
filter.ex Update copyright, also 2022-02-12 11:53:32 -06:00
following_relationship.ex Update copyright, also 2022-02-12 11:53:32 -06:00
formatter.ex Update copyright, also 2022-02-12 11:53:32 -06:00
frontend.ex Update copyright, also 2022-02-12 11:53:32 -06:00
gun.ex Update copyright, also 2022-02-12 11:53:32 -06:00
hashtag.ex Update copyright, also 2022-02-12 11:53:32 -06:00
healthcheck.ex Update copyright, also 2022-02-12 11:53:32 -06:00
html.ex Update copyright, also 2022-02-12 11:53:32 -06:00
http.ex Update copyright, also 2022-02-12 11:53:32 -06:00
instances.ex Update copyright, also 2022-02-12 11:53:32 -06:00
job_queue_monitor.ex Update copyright, also 2022-02-12 11:53:32 -06:00
jwt.ex Update copyright, also 2022-02-12 11:53:32 -06:00
keys.ex Update copyright, also 2022-02-12 11:53:32 -06:00
list.ex Update copyright, also 2022-02-12 11:53:32 -06:00
logging.ex Update copyright, also 2022-02-12 11:53:32 -06:00
maintenance.ex Update copyright, also 2022-02-12 11:53:32 -06:00
maps.ex Update copyright, also 2022-02-12 11:53:32 -06:00
marker.ex Update copyright, also 2022-02-12 11:53:32 -06:00
mfa.ex Update copyright, also 2022-02-12 11:53:32 -06:00
moderation_log.ex Update copyright, also 2022-02-12 11:53:32 -06:00
notification.ex Delete report notifs when demoting from superuser 2022-05-09 10:44:43 -05:00
object.ex Update copyright, also 2022-02-12 11:53:32 -06:00
object_tombstone.ex Update copyright, also 2022-02-12 11:53:32 -06:00
otp_version.ex Update copyright, also 2022-02-12 11:53:32 -06:00
pagination.ex Update copyright, also 2022-02-12 11:53:32 -06:00
password_reset_token.ex Update copyright, also 2022-02-12 11:53:32 -06:00
registration.ex Update copyright, also 2022-02-12 11:53:32 -06:00
release_tasks.ex Update copyright, also 2022-02-12 11:53:32 -06:00
repo.ex Update copyright, also 2022-02-12 11:53:32 -06:00
report_note.ex Update copyright, also 2022-02-12 11:53:32 -06:00
reverse_proxy.ex Update copyright, also 2022-02-12 11:53:32 -06:00
scheduled_activity.ex Update copyright, also 2022-02-12 11:53:32 -06:00
signature.ex Update copyright, also 2022-02-12 11:53:32 -06:00
stats.ex Update copyright, also 2022-02-12 11:53:32 -06:00
thread_mute.ex Update copyright, also 2022-02-12 11:53:32 -06:00
upload.ex Update copyright, also 2022-02-12 11:53:32 -06:00
user.ex Allow user to register with custom language 2022-05-09 10:44:43 -05:00
user_invite_token.ex Update copyright, also 2022-02-12 11:53:32 -06:00
user_note.ex Update copyright, also 2022-02-12 11:53:32 -06:00
user_relationship.ex Update copyright, also 2022-02-12 11:53:32 -06:00
utils.ex Update copyright, also 2022-02-12 11:53:32 -06:00
web.ex Update copyright, also 2022-02-12 11:53:32 -06:00
xml_builder.ex Update copyright, also 2022-02-12 11:53:32 -06:00