【发布时间】:2014-11-26 21:17:15
【问题描述】:
我正在尝试 Mandrill。看起来很好。我注册了一个帐户并获得了一个 api 密钥。从下载 Mandrill PHP 包装器 https://bitbucket.org/mailchimp/mandrill-api-php
这篇文章似乎有一个很好的 hello-world Mandrill 电子邮件示例,所以我试了一下:
Simple php function to send an email with Mandrill
不断收到此错误:
API call to templates/add failed: Problem with the SSL CA cert (path? access rights?)
我按照这些 S.O. 的指示进行操作。帖子:
error in send email using Mandrill (php) HTTPS and SSL3_GET_SERVER_CERTIFICATE:certificate verify failed, CA is OK
从http://curl.haxx.se/docs/caextract.html获取.pem文件
并确保 curl api 指向 Mandrill api 中的那个文件
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt ($ch, CURLOPT_CAINFO, "pathto/cacert.pem");
.pem 文件是可读的。没有疯狂的权限情况。
没有帮助。同样的交易:
API call to templates/add failed: Problem with the SSL CA cert (path? access rights?)
谷歌搜索我在这里遵循 CentOS 6.0 步骤: http://kb.kerio.com/product/kerio-connect/server-configuration/ssl-certificates/adding-trusted-root-certificates-to-the-server-1605.html
以及这里的步骤: http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/
同样的错误。作为最后一次尝试,我将 curl 设置为完全忽略 ssl 步骤。当然不建议这样做,但我只是想在我的脚下感受坚实的地面。我回到 Mandrill.php 并试了一下。
curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);
同样的错误。我想知道是否其他人可以为我阐明这一点。我已经用尽了谷歌。 (它给了我一个recaptcha,因为我使用它太多了)。感谢您的宝贵时间!
(系统:CentOS 6.5,PHP 5.3)
【问题讨论】: