Fix TLS config #473
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
high priority
invalid
L
low priority
M
medium priority
needs refinement
optional
question
S
UX research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: local-it/mitgliederverwaltung#473
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bugfix/fix-tls-config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description of the implemented changes
The changes were:
Fix SMTP configuration so that both port 587 (TLS/STARTTLS) and port 465 (implicit SSL) work. Previously, a single set of options caused either 587 to crash (invalid option for TCP) or 465 to fail (missing verify option for the initial SSL connection). The fix makes socket options conditional on the chosen mode.
What has been changed?
smtp_config/0now addssockopts: [verify: verify_mode]only when using SSL (port 465). For TLS (587) no verify option is passed in sockopts, sogen_tcp:connectno longer receives invalid options.SMTP_SSL=ssl).:verifyin sockopts, (2) port 465 config includes:verifyin sockopts, (3) correct TLS/SSL mode for 587 and 465.Definition of Done
Code Quality
Accessibility
N/A – no UI or frontend changes in this PR.
Testing
N/A – no new UI; existing mailer/config_smtp tests plus new mailer_smtp_config_test.exs cover the change.
Additional Notes
verifyin the options passed to the first connection (TCP), while 465 must getverifyin the options for the initialssl:connect. The new tests encode both requirements.SMTP_VERIFY_PEERremainsfalse(verify_none); setting it totruerequires CA certs to be configured (e.g.cacertfile) or you get an incompatible-options error.