SwiftMailer connection established error

别来无恙 提交于 2019-12-08 13:27:27

The fix here solved it for me: https://github.com/swiftmailer/swiftmailer/issues/544

@if-joerch if-joerch commented on Nov 3, 2014

If you are using PHP 5.6, the error does occur because of the "SSL context options" used for the stream context in swiftmailer. IN PHP 5.6 verify_peer and verify_peer_name the default was set to TRUE, so PHP checks the SSL certificate. It is currently not possible to disable it in swiftmailer using some options.

You could disable the SSL check by modifying the function "_establishSocketConnection" in StreamBuffer.php. Add these lines before stream_socket_client command:

$options['ssl']['verify_peer'] = FALSE;
$options['ssl']['verify_peer_name'] = FALSE;

It would be great if these options could be set without hacking the code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!