You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The constructor of the EsmtpTransport offers the boolean parameter "tls", but even if configured to false, it switches to an encrypted connection if the server supports tls. This is an issue because if you try to connect to localhost, the certificate can not match and the connection fails with the exception: "SSL routines::certificate verify failed"
How to reproduce
Test on a system which accepts mail on localhost port 25, and that support STARTTLS:
<?php
use Symfony\Component\Mime\Email;
use Symfony\Component\Mailer\Mailer;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
require_once 'vendor/autoload.php';
$email = (new Email())
->from('[email protected]')
->to('[email protected]')
->subject('Test E-Mail')
->text('Test!');
$transport = new EsmtpTransport('localhost', 25, false);
$mailer = new Mailer($transport);
$mailer->send($email);
Possible Solution
In my opinion, the correct solution would be to either honor the tls parameter or not to verify the certificate, if the host is localhost.
Additional Context
No response
The text was updated successfully, but these errors were encountered:
You can access the underlying stream through getStream(). With this when an instance of SocketStream you should be able to disable the verification using the standard stream context options.
Symfony version(s) affected
7.0
Description
The constructor of the EsmtpTransport offers the boolean parameter "tls", but even if configured to false, it switches to an encrypted connection if the server supports tls. This is an issue because if you try to connect to localhost, the certificate can not match and the connection fails with the exception: "SSL routines::certificate verify failed"
How to reproduce
Test on a system which accepts mail on localhost port 25, and that support STARTTLS:
Possible Solution
In my opinion, the correct solution would be to either honor the tls parameter or not to verify the certificate, if the host is localhost.
Additional Context
No response
The text was updated successfully, but these errors were encountered: