8

AWS SDK 发送请求的时候提示Signature expired 错误

 3 years ago
source link: https://segmentfault.com/a/1190000040232601
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

AWS SDK 发送请求的时候提示Signature expired 错误

发布于 43 分钟前

完整的错误信息如下:

error: getting secrets manager: secrets (code=Unknown): InvalidSignatureException: Signature expired: 20210622T225815Z is now earlier than 20210623T132051Z (20210623T132551Z - 5 min.)

    status code: 400, request id: 86ca5214-558d-41aa-aae8-b458d64bedad

原因和解决

这个错误的原因可能是你本地发送请求的计算机的时间与真实的时间不对。

通过命令 date 进行查看后,发现当前的时间与真实的时间差了 1 天多。

这是因为我们的测试环境使用的是 WSL Windows 的 Ubuntu 环境,这个环境的计算时钟是不和 Windows 同步的,当你对计算机休眠或者关机后,计算机的时钟就出现偏差了。

因此你需要对你的操作系统进行时钟同步。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK