PHP(7.1)与mail,openssl,证书有关的问题

时间:2018-11-17 13:27:25

标签: php openssl dovecot exim

php.ini 中,我有:

[openssl]
openssl.cafile= /etc/ssl/cert/mydomaincabundle.crt

此行允许通过 Wordpress 或我使用 mydomain的PHP应用程序从 PHP SMTP 发送电子邮件。 ext 证书。

现在我需要use composer,我发现当像作曲家之类的PHP应用程序尝试下载数据时,此行会生成SSL错误。错误是:

file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
    Now trying to download from source

如果我删除 php.ini

[openssl]
openssl.cafile= /etc/ssl/cert/mydomaincabundle.crt

此问题已解决,但我开始看到所有 PHP邮件均失败,因此 Wordpress 之类的应用程序无法发送电子邮件。 >

如何处理邮件并解决PHP SSL问题?

如果我删除通过 SMTP SSL 发送的证书电子邮件中的 openssl 行,将会失败。

Connection: opening to ssl://domain.it:465, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): Failed to enable crypto
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to ssl://domain.it:465 (Unknown error)
SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

谢谢。

1 个答案:

答案 0 :(得分:0)

已解决https://github.com/composer/composer/issues/7797#issuecomment-440680491

在centos中的位置似乎有些不同如何在centos7中添加证书颁发机构?

我在etc / pki / ca-trust / extracted / openssl上找到了它