PHP "file_get_contents" "Unable to set verify locations"

PHP "file_get_contents" "Unable to set verify locations"

我已经检查过了:

我仍然收到此 错误:

Warning: file_get_contents(): Unable to set verify locations '/var/www/duo-security/id_rsa' '(null)' in /var/www/duo-security/FileRequester.php

我通过这样做确保 Apache 用户可以读取此文件:

sudo www-data nano /var/www/duo-security/security.pub

这就是我正在做的事情:

  $context = Array
(
[http] => Array
    (
        [timeout] => 10
        [method] => POST
        [header] => Array
            (
                [0] => Date: Tue, 31 Nov 3015 12:40:19 +0530
                [1] => Host: api-xxxxxx.duosecurity.com
                [2] => Authorization: Basic REmQV1o0SEEyLzZFS2FWMDUzUFc6ZmMwZGM5ZDUxOWI4ZjY1ZDI2NTIwYWNmYjhiYTk2N2VlOTI4OTc0OA==
                [3] => Content-Type: application/x-www-form-urlencoded
                [4] => Content-Length: 40
            )

        [content] => username=userid
    )

[ssl] => Array
    (
        [allow_self_signed] => 1
        [cafile] => /var/www/path/security.pub
        [verify_peer] => 1
        [verify_peer_name] => 1
    )

 );

这是因为证书文件的路径无效。尝试更改参数“cafile”或确保 security.pub 是有效证书。