Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tls options in sockopts for ssl connection #214

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alappe
Copy link
Contributor

@alappe alappe commented Jun 20, 2022

While trying to make bamboo_smtp work with the smtp server of domainfactory (df.eu), I found I needed some options handled differently. While I'm not into the topic taming the ssl beast, I wanted to share it and maybe collect some feedback if this is wrong on my end or should fully/partly merged into bamboo_smtp.

Using it with (username/password/hostname omitted):

adapter: Bamboo.SMTPAdapter,
server: "sslout.df.eu",
port: 465,
tls: :if_available,
retries: 3,
auth: :always,
ssl: true,
tls_verify: :verify_peer,
tls_server_name_indication: "sslout.df.eu",
tls_depth: 10,
tls_log_level: :debug,
tls_cacertfile: CAStore.file_path()

It seems to me that gen_smtp (v1.2) gave up on collecting/validating the tls options (gen-smtp/gen_smtp@3cfd421) and is simply passing sockopts to ssl:connect() while using tls_options when using STARTTLS. If I read this right it might be easier to do the same, skip the validation of known tls-related config keys/values, move the configuration to tls: [ verify: :verify_peer, … ] and pass this to gen_smtp. But this would be a breaking change…

Any opinions?

Copy link

@DerTim1 DerTim1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and tested the changes. We also need the ability to set server_name_indication to work again with smtp.office365.com (Server-Name-Indication: outlook.com).

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants