即使使用正确的键,S3 boto 连接也会导致 ClientError

S3 boto connection resulting into ClientError even with the right keys

我是运行一个命令:

aws s3 cp s3://full-key .

我已确保两台电脑上的密钥相同,但是,一台电脑能够访问该对象,而另一台电脑收到错误消息:

/usr/local/lib/python2.7/dist-packages/urllib3/util/ssl_.py:354: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  SNIMissingWarning
fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden

需要注意的是我的实例时区是UTC 命令:

timedatectl status                   
      Local time: Fri 2019-01-04 09:04:39 UTC
  Universal time: Fri 2019-01-04 09:04:39 UTC
        Timezone: Etc/UTC (UTC, +0000)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

但是当我输入 date 我得到 Fri Jan 4 09:05:44 UTC 2019 但是,google 将 utc 时间显示为:8:52 am Friday, 4 January 2019 Coordinated Universal Time (UTC)

我注意到我的 ec2 实例上的奇怪时间设置。虽然设置是 UTC,但时间不是。当我尝试列出存储桶中的所有目录时,遇到错误:too much time difference resulting into timeout。因此,我手动将实例的时间更改为实际的UTC时间并再次尝试,然后可以访问存储桶。

为什么我要尝试时间设置?我在某处读到时间可能是这里的一个问题。