确保您拥有足够的AWS IAM权限来修改策略。
在您的AWS IAM策略中,确保您已经正确设置了SecureTransport:false。如果没有,请使用以下策略:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": "*",
"Condition": {
"Bool": {
"aws:SecureTransport": "false"
}
}
}
]
}
AmazonS3 s3Client = AmazonS3Client.builder()
.withClientConfiguration(new ClientConfiguration().withProtocol(Protocol.HTTP))
.build();
aws s3 ls --no-verify-ssl s3://my-bucket/
注意:在开发环境中禁用安全传输可能会导致敏感数据被盗。在生产环境中,强烈建议启用安全传输。