签名不匹配相同的实现在不同的环境中工作



我正在使用aws java sdk sts',版本:"1.12.166"尝试连接到sqs队列,从中读取消息,并使用apache camel-comale aws sqs:3.0.0将它们路由到路由。当我部署解决方案时,我收到以下错误:

failed polling endpoint: aws-sqs://MY-QUEUE-IN?
accessKey=AKIXXXXXXXXXXXXXXXX&autoCreateQueue=false&maxMessagesPerPoll=1&queueUrl=https%3A%2F%2Fsqs.eu-central-1.amazonaws.com%2F111111111111%2FMY-QUEUE-IN-IN&region=EU_CENTRAL_1&secretKey=xxxxxx. 
Will try again at next poll. 
Caused by: [com.amazonaws.services.sqs.model.AmazonSQSException - The request signature we calculated does not match the signature you provided.
Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
nnThe Canonical String for this request should have beenn'POSTn/111111111111/MY-QUEUE-INnnamz-sdk-invocation-id:cc8c4702-664c-e76e-c071-ca02662a9aednamz-sdk-request:ttl=20220812T181141Z;attempt=1;max=4namz-sdk-retry:0/0/0nhost:sqs.eu-central-1.amazonaws.comnuser-agent:aws-sdk-java/1.12.166 Linux/5.4.172-90.336.amzn2.x86_64 OpenJDK_64-Bit_Server_VM/25.242-b08 java/1.8.0_242 vendor/IcedTea cfg/retry-mode/legacynx-amz-date:20220812T181051Znnamz-sdk-invocation-id;amz-sdk-request;amz-sdk-retry;host;user-agent;x-amz-daten62bd803266d1241d4d977f450bc1dec1a924d61a9fe6e7ca76a26c6acf706134'nn
The String-to-Sign should have beenn'AWS4-HMAC-SHA256n20220812T181051Zn20220812/eu-central-1/sqs/aws4_requestn8d1d936c48bdd037fdc35a20cbcfdc3da6b6275e753d2d821c689ce7690c8de8' (Service: AmazonSQS; Status Code: 403; 

我用来发送请求的代码

from("aws-sqs:" + QueueName +
"?queueUrl=" + Endpoint + QueueName+
"&accessKey=" + AccessKey +
"&secretKey=" + SecretKey +
"&region=" + Region +
"&autoCreateQueue=false" +
"&maxMessagesPerPoll=" + pollingMessagesMax
)

我通过我传递的配置文件提供参数:

  • QUEUENAME:'MY-QUE-IN'
  • 终结点:'https://sqs.eu-central-1.amazonaws.com/111111111111/'
  • 区域:'EU_CENTRAL_1'

access和secretKey在我的秘密中定义。

我在不同的环境中使用相同的SDK,具有相同的含义,它正在工作。我唯一的区别是在这个环境中我有不同的访问权限和secretkey我在这个env中的密钥包含//类似ABCDHERMHHJJJJJq+PU/dGejhdsh/wE7lwHtqjAHJKL 的内容

我读到这可能是的问题

当我生成一个不包含"+"字符的新secretKey时,问题得到了解决。说明密钥中的"+"字母是问题的原因

相关内容

  • 没有找到相关文章

最新更新