2012-04-27 121 views
0

想知道是否有人知道亚马逊AWS会告诉我为什么“您提供的X509证书不存在于我们的记录中。”我在使用亚马逊AWS PHP SDK时遇到了X509错误

下面是我使用的代码...

$sqs = new AmazonSQS(); 
$queue_url = 'my_url'; 
$options = array(
    'MaxNumberOfMessages' => 10, 
); 
$resp = $sqs->receive_message($queue_url, $options); 

print_r($resp); 

这是我得到的回应......

[Type] => Sender 
[Code] => InvalidClientTokenId 
[Message] => The X509 Certificate you provided does not exist in our records. 
[Detail] => CFSimpleXML Object 

这里的CFCredentials阵列我使用的是内部的config.inc.php ...

'@default' => array(
    'key' => 'my-key', 
    'secret' => 'my-secret', 
    'default_cache_config' => 'cache', 
    'certificate_authority' => FALSE 
) 

回答

0

我得到这个错误的原因是因为我使用的MAMP PRO没有使用SSL安装CURL。只有CURL。

所以为了解决这个问题,我可以从我的本地机器上测试下面的代码。注意第二行的“@”。我用这个来抑制disable_ssl()方法给出的警告。

$s3 = new AmazonS3(); 
@$s3->disable_ssl(); 
+1

注意:这不建议用于直播/制作代码。 – Chad 2012-05-03 18:41:41

0

为了使用Amazon SQS,您必须特别注册Amazon SQS;它看起来像你不注册。您可以通过访问this page并单击标有“注册Amazon SQS”的按钮来完成此操作。

+0

我实际上已经注册并且已经创建了多个队列。 – Chad 2012-04-29 02:26:36

+0

你必须使用'https'吗? – Chad 2012-04-29 02:27:20