简体   繁体   English

通过HTTP通过Amazon Web Service SES时发生SignatureDoesNotMatch错误

[英]SignatureDoesNotMatch error while amazon web service SES through HTTP

I am stuck at SignatureDoesNotMatch error while using aws ses. 使用aws ses时,我陷入SignatureDoesNotMatch错误。 I am creating signature key by using GMT DATE and security key with HMAC SHA256 and then converting it to Base64. 我通过使用GMT DATE和HMAC SHA256的安全密钥来创建签名密钥,然后将其转换为Base64。

Signature = base64(HMAC SHA256(Date,Security KEY)); 签名= base64(HMAC SHA256(Date,Security KEY));

Url: https://email.us-west-2.amazonaws.com?Action=SendEmail&Source=exmaple%40gmail.com&Destination.ToAddresses.member.1=person2%40gmail.com&Message.Subject.Data=Hey&Message.Body.Text.Data=Hello 网址: https//email.us-west-2.amazonaws.com? Action = SendEmail Source = exmaple%40gmail.com Destination.ToAddresses.member.1 = person2%40gmail.com Message.Subject.Data = Hey &Message.Body.Text。数据=你好

And input headers as x-amz-date: Thu, 30 Jul 2015 18:15:51 +0000 输入标头为x-amz-date:2015年7月30日,星期四18:15:51 +0000

X-Amzn-Authorization: AWS3-HTTPS AWSAccessKeyId=AccessKEY,Algorithm=HmacSHA256,Signature=sign calculated using DATE and security Key. X-Amzn-授权:AWS3-HTTPS AWSAccessKeyId = AccessKEY,算法= HmacSHA256,Signature =使用DATE和安全密钥计算得出的符号。

Please tell me if i am calculating signature in wrong way or anything else is the problem? 请告诉我我是用错误的方式计算签名还是其他问题?

I ran into a similar problem with a different service the other day and the solution was my parameters were not alphabetically ordered. 前几天,我在另一项服务中遇到了类似问题,解决方案是我的参数没有按字母顺序排序。 You should try switching the "Message.Subject.Data" order with the "Message.Body.Text.Data" as the latter should appear earlier lexicographically. 您应该尝试用“ Message.Body.Text.Data”切换“ Message.Subject.Data”顺序,因为后者应按字典顺序显示。 This should fix your problem. 这应该可以解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM