fix(mailer): keep certificate checks for Swoosh HTTP adapters

The TLS version override replaced all Hackney TLS defaults. On OTP 26+
this fails with cacerts: :undefined; on older OTP it skipped certificate
checks. Closes #7962 on the public tracker.
This commit is contained in:
Lain Soykaf 2026-10-21 08:21:43 +04:00
commit 830455d197
No known key found for this signature in database
5 changed files with 19 additions and 3 deletions

View file

@ -39,7 +39,9 @@ defmodule Pleroma.Emails.Mailer do
# temporary hackney fix until hackney max_connections bug is fixed
# https://git.pleroma.social/pleroma/pleroma/-/issues/2101
email =
Swoosh.Email.put_private(email, :hackney_options, ssl_options: [versions: [:"tlsv1.2"]])
Swoosh.Email.put_private(email, :hackney_options,
ssl_options: Pleroma.HTTP.TLS.ssl_options(versions: [:"tlsv1.2"])
)
case enabled?() do
true -> Swoosh.Mailer.deliver(email, parse_config(config))