The issue
I am using Protonmail with a custom Domain, therefore I need the Protonmail Bridge to be able to send via SMTP.
So far so good, the problem is that by the nature of a bridge the actual "server" is on 127.0.0.1, that is what I suspect to be the problem here. I found 2 lines of code that I would like to add that apparently solves this certificate issue, yet I wouldn't really know where to put it.
I hope you can help me with this one, or lead me to a better solution. Nevertheless I would like to send E-Mails from my Domain.
swiftmailer:
stream_options:
ssl:
verify_peer: false
verify_peer_name: false
From: https://stackoverflow.com/questions/36454920/swiftmailer-php-how-to-disable-ssl-certificate-validation
Flarum information
[2023-04-17 08:44:10] flarum.ERROR: Swift_TransportException: Connection could not be established with host 127.0.0.1 :stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:0A000086:SSL routines::certificate verify failed in /var/www/forum.vee.ci/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:261
Stack trace:
#0 [internal function]: Swift_Transport_StreamBuffer->{closure}()
#1 /var/www/forum.vee.ci/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(264): stream_socket_client()
#2 /var/www/forum.vee.ci/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(58): Swift_Transport_StreamBuffer->establishSocketConnection()
#3 /var/www/forum.vee.ci/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(143): Swift_Transport_StreamBuffer->initialize()
#4 /var/www/forum.vee.ci/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(66): Swift_Transport_AbstractSmtpTransport->start()
#5 /var/www/forum.vee.ci/vendor/illuminate/mail/Mailer.php(521): Swift_Mailer->send()
#6 /var/www/forum.vee.ci/vendor/illuminate/mail/Mailer.php(288): Illuminate\Mail\Mailer->sendSwiftMessage()
#7 /var/www/forum.vee.ci/vendor/illuminate/mail/Mailer.php(212): Illuminate\Mail\Mailer->send()
#8 /var/www/forum.vee.ci/vendor/flarum/core/src/Api/Controller/SendTestMailController.php(43): Illuminate\Mail\Mailer->raw()
#9 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/RouteHandlerFactory.php(41): Flarum\Api\Controller\SendTestMailController->handle()
#10 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/Middleware/ExecuteRoute.php(27): Flarum\Http\RouteHandlerFactory->Flarum\Http\{closure}()
#11 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\ExecuteRoute->process()
#12 /var/www/forum.vee.ci/vendor/flarum/core/src/Api/Middleware/ThrottleApi.php(33): Laminas\Stratigility\Next->handle()
#13 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Api\Middleware\ThrottleApi->process()
#14 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(44): Laminas\Stratigility\Next->handle()
#15 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\CheckCsrfToken->process()
#16 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/Middleware/ResolveRoute.php(69): Laminas\Stratigility\Next->handle()
#17 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\ResolveRoute->process()
#18 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/Middleware/SetLocale.php(51): Laminas\Stratigility\Next->handle()
#19 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\SetLocale->process()
#20 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(58): Laminas\Stratigility\Next->handle()
#21 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\AuthenticateWithHeader->process()
#22 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(31): Laminas\Stratigility\Next->handle()
#23 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\AuthenticateWithSession->process()
#24 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(52): Laminas\Stratigility\Next->handle()
#25 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\RememberFromCookie->process()
#26 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Laminas\Stratigility\Next->handle()
#27 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\StartSession->process()
#28 /var/www/forum.vee.ci/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Laminas\Stratigility\Next->handle()
#29 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Api\Middleware\FakeHttpMethods->process()
#30 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Laminas\Stratigility\Next->handle()
#31 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\ParseJsonBody->process()
#32 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Laminas\Stratigility\Next->handle()
#33 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\HandleErrors->process()
#34 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/Middleware/InjectActorReference.php(25): Laminas\Stratigility\Next->handle()
#35 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\InjectActorReference->process()
#36 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(75): Laminas\Stratigility\Next->handle()
#37 /var/www/forum.vee.ci/vendor/middlewares/request-handler/src/RequestHandler.php(84): Laminas\Stratigility\MiddlewarePipe->process()
#38 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Middlewares\RequestHandler->process()
#39 /var/www/forum.vee.ci/vendor/middlewares/base-path-router/src/BasePathRouter.php(101): Laminas\Stratigility\Next->handle()
#40 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Middlewares\BasePathRouter->process()
#41 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Middleware/OriginalMessages.php(36): Laminas\Stratigility\Next->handle()
#42 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Laminas\Stratigility\Middleware\OriginalMessages->process()
#43 /var/www/forum.vee.ci/vendor/middlewares/base-path/src/BasePath.php(73): Laminas\Stratigility\Next->handle()
#44 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Middlewares\BasePath->process()
#45 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/Middleware/ProcessIp.php(24): Laminas\Stratigility\Next->handle()
#46 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/Next.php(49): Flarum\Http\Middleware\ProcessIp->process()
#47 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(75): Laminas\Stratigility\Next->handle()
#48 /var/www/forum.vee.ci/vendor/laminas/laminas-stratigility/src/MiddlewarePipe.php(64): Laminas\Stratigility\MiddlewarePipe->process()
#49 /var/www/forum.vee.ci/vendor/laminas/laminas-httphandlerrunner/src/RequestHandlerRunner.php(96): Laminas\Stratigility\MiddlewarePipe->handle()
#50 /var/www/forum.vee.ci/vendor/flarum/core/src/Http/Server.php(45): Laminas\HttpHandlerRunner\RequestHandlerRunner->run()
#51 /var/www/forum.vee.ci/public/index.php(26): Flarum\Http\Server->listen()