PHPMailer 5.2 OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
PHPMailer 5.2 OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
我在 PHP 5.6 服务器上使用 PHPMailer 时遇到此错误。
警告:stream_socket_enable_crypto():SSL 操作失败,代码为 1。OpenSSL 错误消息:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate 在 class.smtp.php 中验证失败第 344 行
有趣的是我正在尝试通过本地 SMTP 服务器@localhost 发送电子邮件,但我没有使用 SSL 或 TLS - 它是端口 25 上的普通 SMTP。
$mail->SMTPSecure=''
$mail->SMTPPort //not set
服务器为网站域安装了有效的 SSL 证书。
我已经阅读了 GitHub 上关于 PHP 5.6 证书验证失败的文档,它似乎没有解决这种情况。
我已经添加了这段代码,但仍然收到错误:
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
我想主要问题是,它抱怨什么 SSL 证书或缺少证书?
PHPMailer 的 github 页面 mentions 此类错误:
This is covered in the troubleshooting docs. PHP 5.6 verifies SSL certificates by default, and if your cert doesn't match, it will fail with this error. The correct solution is to fix your SSL config - it's not PHP's fault!
我看到您遇到了使 PHPMailer 设置不安全的麻烦,因为在 troubleshooting docs 中不推荐。您是否注意到需要 PHPMailer 5.2.10?
The correct fix for this is to replace the invalid, misconfigured or self-signed certificate with a good one. Failing that, you can allow insecure connections via the SMTPOptions property introduced in PHPMailer 5.2.10 (it's possible to do this by subclassing the SMTP class in earlier versions), though this is not recommended
还有 enabling debug output 的建议:
$mail->SMTPDebug = 4;
如果您查看调试输出,您可能会收集到更多有用的信息。
编辑:这也与您的网站的证书无关,它与您的 SMTP 邮件服务器端点托管的证书(如果有)有关。
我在 PHP 5.6 服务器上使用 PHPMailer 时遇到此错误。
警告:stream_socket_enable_crypto():SSL 操作失败,代码为 1。OpenSSL 错误消息:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate 在 class.smtp.php 中验证失败第 344 行
有趣的是我正在尝试通过本地 SMTP 服务器@localhost 发送电子邮件,但我没有使用 SSL 或 TLS - 它是端口 25 上的普通 SMTP。
$mail->SMTPSecure=''
$mail->SMTPPort //not set
服务器为网站域安装了有效的 SSL 证书。
我已经阅读了 GitHub 上关于 PHP 5.6 证书验证失败的文档,它似乎没有解决这种情况。
我已经添加了这段代码,但仍然收到错误:
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
我想主要问题是,它抱怨什么 SSL 证书或缺少证书?
PHPMailer 的 github 页面 mentions 此类错误:
This is covered in the troubleshooting docs. PHP 5.6 verifies SSL certificates by default, and if your cert doesn't match, it will fail with this error. The correct solution is to fix your SSL config - it's not PHP's fault!
我看到您遇到了使 PHPMailer 设置不安全的麻烦,因为在 troubleshooting docs 中不推荐。您是否注意到需要 PHPMailer 5.2.10?
The correct fix for this is to replace the invalid, misconfigured or self-signed certificate with a good one. Failing that, you can allow insecure connections via the SMTPOptions property introduced in PHPMailer 5.2.10 (it's possible to do this by subclassing the SMTP class in earlier versions), though this is not recommended
还有 enabling debug output 的建议:
$mail->SMTPDebug = 4;
如果您查看调试输出,您可能会收集到更多有用的信息。
编辑:这也与您的网站的证书无关,它与您的 SMTP 邮件服务器端点托管的证书(如果有)有关。