知道为什么我的 PayPal IPN Listener 自发开始抛出错误吗?

Any ideas why my PayPal IPN Listener spontaneously started throwing errors?

截至周六,当我的 PayPal IPN 触发时,我突然收到 "cURL error: [60] SSL certificate problem: unable to get local issuer certificate"。几个月来我没有更改我网站上的任何代码,据我所知,我没有 运行 任何会干扰的自动升级。

我已经阅读了数十篇 Stack 帖子,但其中没有任何效果。我已将 .crt 移动到其他目录并更新 cURLOPT_CAINFO。重新启动 httpd 和 cpanel。在 php.ini 中列出证书。 (在开始之前它不存在,所以我怀疑是这样。)下载并安装了 .pem 文件,我认为这与此无关。 None 个有效。

PayPal 已验证正在发送 IPN 消息,并且 PayPal 沙盒已成功验证握手。网站上有一个普通的 ol' SSL,它运行正常。

服务器是 GoDaddy VPS、CentOs Linux 7 和 Apache 2.4.41。

愿意关闭 VERIFYPEER 或在不安全的设置中运行。

我的代码:

protected function curlPost($encoded_data)
    {
        $uri = 'https://'.$this->getPaypalHost().'/cgi-bin/webscr';
        $this->post_uri = $uri;

        $ch = curl_init();

        if ($this->verify_ssl) {
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
            curl_setopt($ch, CURLOPT_CAINFO, '/home/shopusa/public_html/app/Support/cert/api_cert_chain.crt');
        }

        curl_setopt($ch, CURLOPT_URL, $uri);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded_data);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $this->follow_location);
        curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HEADER, true);

        $this->response = curl_exec($ch);
        $this->response_status = strval(curl_getinfo($ch, CURLINFO_HTTP_CODE));

        if ($this->response === false || $this->response_status == '0') {
            $errno = curl_errno($ch);
            $errstr = curl_error($ch);
            throw new Exception("cURL error: [$errno] $errstr");
        }

        return $this->response;
    }

根据终端,文件在此处,归网络用户所有:

[root@ip-###-###-###-## cert]# cd /home/shopusa/public_html/app/Support/cert/
[root@ip-###-###-###-## cert]# ls
api_cert_chain.crt  _notes

所有权限都是755/目录和644/文件。

有没有什么事情突然发生在任何人身上?我花了大约八个小时来解决这个问题,但我不知道如何让 IPN 侦听器再次触发。

api_cert_chain.crt 替换为 更新的 证书颁发机构捆绑包,该捆绑包能够验证 PayPal 服务器的当前加密安全证书的颁发者。

可能来自 https://curl.haxx.se/docs/caextract.html(如有必要,将 pem 转换为 crt,但我认为不是)