Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Mailer] Fixed 'verify_peer' option in mailer DSN being ignored#37961
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
fabpot left a comment
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.
Can you add a test case to cover this fix?
src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransportFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
snake-4 commentedAug 27, 2020
I've added some test cases to cover this fix in my latest commit but I've also added a check to avoid disabling the verification for a DSN like this |
src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransportFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mailer/Tests/Transport/Smtp/EsmtpTransportFactoryTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
fabpot commentedAug 31, 2020
Thank you @SnakePin. |
The mailer DSN option 'verify_peer' was being ignored because
$dsn->getOption('verify_peer', true)was returning a string and thus NOT operator on it was always resulting in false. I propose changing the line where it is used with afilter_varcall with theFILTER_VALIDATE_BOOLEANas the filter parameter to overcome this issue.