php alert函数 403报错,SES AWS Error Code: SignatureDoesNotMatch, Status Code: 403

问题

I'm getting a AWS Error Code: SignatureDoesNotMatch, Status Code: 403 when trying to send a mail through Amazon SES.

I have confirmed that I am using the correct credentials which I created via https://console.aws.amazon.com/iam/home?#users and the error still persists.

I assume the credentials I've created on the iam/home are in fact global but I do not know what I am doing wrong further. The entire error is:

AWS Error Code: SignatureDoesNotMatch, Status Code: 403, AWS Request

ID: xxx, AWS Error Type: client, AWS Error Message: Signature expired:

20140314T031111Z is now earlier than 20140317T15116Z (20140317T151111Z

- 5 min.), User-Agent: aws-sdk-php2/2.5.3 Guzzle/3.8.1 curl/7.22.0 PHP/5.3.10-1ubuntu3.10 thrown in

/url/Vendor/Aws/Common/Exception/NamespaceExceptionFactory.php on line

91

The actual code is code I pulled from: http://docs.aws.amazon.com/aws-sdk-php/latest/class-Aws.Ses.SesClient.html#_sendEmail

I am firing this script from my local environment.

Where would I be able to find credentials that would work?

回答1:

This looks like a clock skew issue. The time of the machine you are sending the request from is too different from the Amazon SES server's time. This is causing your signature to be invalid. Your credentials are probably fine. Correct your machine's clock or sync up with an NTP server.

回答2:

Along with this solution I have done the following.

1) I have created the user with PowerUser policy in IAM.

2) Updated the secret/access key in my code.

Now it's working.

Not sure why SMTP credentials(Which are created under SES Dashboard) are not working.

来源:https://stackoverflow.com/questions/22459155/ses-aws-error-code-signaturedoesnotmatch-status-code-403

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值