-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer] add ability to disable the TLS peer verification via DSN #35262
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
Conversation
Do we actually want to allow that ? Disabling peer verification means that your TLS connection is insecure (anyone can do a MitM attack without any issue). |
What is the use case to add such feature ? |
In case of internal enterprise SMTP with self signed certificate, it's currently impossible to send mail without this. I'm aware that's an insecure way to do things, but there is no way to force no use of TLS connection to work around this issue. I think it's a good compromise in term of security between no encryption at all and fully authenticated TLS connection. |
The way to go here would be to trust your internal CA that signed your certificate. TLS without certificate verification is a big red flag. |
The issue here is I cannot trust any CA because it's a self signed certificate. By design there is no CA on a self signed certificate. I do know it's a bad way to do things, but I have no control over the SMTP server which use this certificate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, here are some suggestions.
i have the same problem ! |
src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransportFactory.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Transport/Smtp/Stream/SocketStream.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good thanks, here are some comments to finish the PR.
Can you add a test case maybe?
Please also add a line in the CHANGELOG of the component and update the description of the PR to keep it in sync.
(approved by mistake, PR is not ready)
(please add a line in the changelog of the component) |
src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransportFactory.php
Outdated
Show resolved
Hide resolved
ea3de33
to
4b854da
Compare
Thank you @Livda. |
…n via DSN (Aurélien Fontaine) This PR was squashed before being merged into the master branch (closes #12997). Discussion ---------- [Mailer] add ability to disable the TLS peer verification via DSN Documentation for the PR symfony/symfony#35262 Commits ------- 28a391a [Mailer] add ability to disable the TLS peer verification via DSN
#mailer.yaml parameters: framework: |
Is there a chance to make this functionality available in Symfony 4.4 as well? |
@pschirch i need it too ! |
Regarding the post from @hectorprats , is this the recommended way? No way to set it only with the |
It works, but 0 !== boolean. it's better to keep the semantic. |
@hectorprats Sorry, but this is unnecessary. Your version also ends in |
null is not the same as false. And.. read better my version. You can see the transformation. |
It results in the same string inside |
@pschirch @roublarstar I described on SO on how to get this working in 4.4 by overriding EsmtpTransportFactory: Still it would be great if this can be ported to 4.4 :) |
It seems that this patch is not on the 4.4 branch ... Could you put in version 4.4x? |
For all those who are on 4.4 and
|
Add the ability to disable the peer TLS verification with the DNS when using
EsmtpTransport
like this :By default the verification is enabled