[英]laravel shows error when sending email using tls and my own postfix/virtualmin server
We have installed our own postfix/virtualmin server and we have a laravel application,the problem is when we use external smtp servers, it is not problem to use tls option, and the emails are getting sent ok, but when using our new smtp server, when using tls we have this error :我们已经安装了我们自己的 postfix/virtualmin 服务器,我们有一个 Laravel 应用程序,问题是当我们使用外部 smtp 服务器时,使用 tls 选项没有问题,并且电子邮件可以正常发送,但是当使用我们新的 smtp 服务器时, 使用 tls 时出现此错误:
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
It has to be something regarding missing certificates in our postfix/virtualmin server, but, i do not know where to start, we have already a letsencrypt certificates for it, but i believe we maybe need to convert them to ca or something like that ?它必须与我们的 postfix/virtualmin 服务器中缺少证书有关,但是,我不知道从哪里开始,我们已经为它准备了一个 Letencrypt 证书,但我相信我们可能需要将它们转换为 ca 或类似的东西? i'm not sure, that's why i need your help.
我不确定,这就是为什么我需要你的帮助。
Thank you,谢谢,
Download the latest cacert.pem file from cURL website .从cURL 网站下载最新的cacert.pem文件。
wget https://curl.haxx.se/ca/cacert.pem
Edit php.ini (you can do php --ini
to find it), update (or create if they don't exist already) those two lines:编辑 php.ini (您可以执行
php --ini
来找到它),更新(如果它们不存在,则创建)这两行:
curl.cainfo="/path/to/downloaded/cacert.pem"
...
openssl.cafile="/path/to/downloaded/cacert.pem"
Those lines should already exist but commented out, so uncomment them and edit both values with the path to the downloaded cacert.pem
这些行应该已经存在但已注释掉,因此取消注释它们并使用下载的
cacert.pem
的路径编辑这两个值
Restart PHP and Nginx/Apache.重启 PHP 和 Nginx/Apache。
I figured it out the problem.我想出了问题。
My virtualmin/postfix setup was missing the CA certificiation, and since i used letsencrypt for ssl, i had to put the path of generated CA in the config.我的 virtualmin/postfix 设置缺少 CA 认证,并且由于我将 letencrypt 用于 ssl,我不得不将生成的 CA 的路径放在配置中。
Here : Webmin --> Servers ---> PostFix Mail Server ----> Smtp authentication and encryption.此处:Webmin --> 服务器 ---> PostFix 邮件服务器 ----> Smtp 身份验证和加密。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.